's password: kittens
- Welcome home! -

uname -a
Matt Kava home #1 SMP
ls
name = trim($name); $this->url = trim($url); $this->length = strlen($this->name); $this->link = trim($link); if(!empty($link) && $this->sym = true) { $this->length = strlen($this->name . " -> ".$this->link); } } public function __toString() { return $this->name; } } /* Class for holding of the Site objects for the `ls` */ class Sites { private $c = 0; // count of items public $s = array(); // the items! /* Adds a site to the list of sites... */ public function Add($site) { // if not an object, don't handle it.. it's a trap! if( !is_object($site) ) return; $this->s[$this->c] = $site; $this->c++; } public function Longest() { $max = 0; foreach($this->s as $site) if( $site->length > $max && $max = $site->length ) {} return $max+1; } /* Ths utilizes the __toString() method of the Site class to sort alphabetically. (Destroys indexing, not that it matters.)*/ public function Organize() { sort($this->s, SORT_STRING); } } // build the site list and organize it $sites = new Sites(); $sites->Add( new Site("CODEBOX", "/codebox") ); $sites->Add( new Site("blog", "http://mattkava.com") ); $sites->Add( new Site("credits", "") ); $sites->Add( new Site("source", "/source.txt") ); $sites->Add( new Site("irc", "http://nfnet.org", "nfnet") ); $sites->Add( new Site("google profile", "http://www.google.com/profiles/ssempirefed") ); $sites->Add( new Site("favicon.ico", "/favicon.ico") ); $sites->Add( new Site("sensors.txt", "/sensors.txt") ); $sites->Add( new Site("twitter", "http://twitter.com/mkava") ); $sites->Add( new Site("pandora", "http://pandora.com/people/ssempirefed") ); $sites->Add( new Site("speedtest.png", "/speedtest.png") ); $sites->Add( new Site("mkava.jpg", "/mkava.jpg") ); $sites->Organize(); $i = 0; $max = $sites->Longest(); // for every Site.. output it! foreach($sites->s as $site) { // limit the listing to some length before dropping down if( $i != 0 && ($i % $ls) == 0) { echo "
\n"; } if( empty($site->url) ) echo $site->name; // no link (a file) else if( !$site->sym ) { // Normal link (a directory) echo "url."\" title=\"".$site->name."\">".$site->name.""; } else { // Symbolic link... echo "url."\" title=\"".$site->link."\">".$site->name." -> ". $site->link .""; } // spacing... $length = $site->length; for(; $length < $max; $length++) echo " "; $i++; echo "\n"; } ?>
cat credits
Created entirely and happily in vim
cd _