Viewing only Geekiness • See All entries

Playing with Panos

Here's a large image of our valley: you can zoom in and out, pan back and forth, and try to find our house!

it's here:

^top   Contact   Geekiness   Permalink   Posted: 06/17/11

Just added a blogspot

I created a site, just to say I had. Don't expect me to actually use it, however.


^top   Contact   Geekiness   Permalink   Posted: 03/13/11

U+30C4: ツ

A smile.

^top   Contact   Geekiness   Permalink   Posted: 02/02/10

It's the domino effect, I tell you!

It's the domino effect, I tell you!

Installing the HbG CMS (gotta find a nicer name for it-- How about "Handy blogging Gizmo"?) on this site has caused me to rework, re-jigger, re-whatever, just about every line of code. (Ah! it's called refactoring code!

I've made it leaner, meaner and less-crashable. I've added some nice CMS tweaks to the Back Room to make it more pleasant (but you need Safari to see them). After I get it finalized (I think I'm 99.9% there) I'll rework the installation, so you're seeing it first here!

Woo hoo. I think I'm gonna change the Version number to 6.0.

Other changes:

Automagically adds Authors to an approved list of commenters; if you have access to the site, you have the ability to leave a comment, using your login and email account.

Better security: can't call up a post by typing its ID into the URL if you're not logged in

^top   Contact   Geekiness   Permalink   Posted: 12/02/09

A home-rolled php text counter

A home-rolled php text counter

Here's the code for a self-starting visitor counter for your site: You don't have to do anything; it creates its own counter file, based on the name of the file it's in. An index.php page will create an "indexcount.dat" file, etc.

Yeah this is geeky, and very much coding 101, but hey. I like Php, even though It's not as sexy as Ruby.

(stick this inside php tags)

(open phptag)

//text-file based counter (make sure the enclosing folder is chmod 775)

$countfile = pathinfo(__FILE__, PATHINFO_FILENAME)."count.dat" ; //creates a separate count file named for any page it is on.

$resetdate = strftime("%D",time()) ; // creates a human-readable date

$count=file($countfile, FILE_IGNORE_NEW_LINES); // reads the count file

if(count($count)<2) { $count = array($resetdate, $visitors = 0 ) ; } //this initalizes an empty count file

$countdate= array_shift($count) ; //takes the first line and uses it for the date

if(empty($countdate)) { $countdate=$resetdate ; } //this is in case the first line of the file is empty

$visitors = ++$count[0] ; // increments the visitors number

if(!is_numeric($visitors)) { $visitors=1 ; } // handles error if something weird is on the visitor line

if(!file_put_contents($countfile,$countdate."\n".$visitors)) { // error handling file permissions

echo 'Can not write to '.$countfile' chmod to 755? ' ; }

echo $visitors.' visitors since '.$countdate ; // the visitor message

(close php tag)


as seen here

^top   Contact   Geekiness   Permalink   Posted: 11/29/09