This page contains odd bits and pieces.

Test Pages

PHP Counter

This PHP script (written by yourstruly):

<?php
        header("Content-type: image/png");
 
        //Load the image
        $im = imagecreatefrompng('pimps.png');
 
        //has a URL been mentioned?
        if(isset($_REQUEST['url'])){
                
                $url = $_REQUEST['url'];
                $url = str_replace('/','_',$url); $url = str_replace('~','_',$url); $url = str_replace('?','_',$url);
                $url = str_replace('&','_',$url); $url = str_replace('.','_',$url); $url = str_replace('%','_',$url);
                $url = str_replace(':','_',$url);
                $filename = "urls/$url";
                $string = '';
 
                //Does the file exist?
                if (file_exists($filename)) {
                        $hits = file($filename);
                        $hits[0] ++;
                        $string = "$hits[0]";
                } else {
                        $string = "1";
                }
                $fp = fopen($filename , "w");
                fputs($fp , $string);
                fclose($fp);
 
                $white = imagecolorallocate($im, 255, 255, 255);
                imagestring ($im, 1, 40, 4, $string, $white);
        }
 
        imagepng($im);
        imagedestroy($im);
?>

Produces these nice counters:

IR Group List

I with the help of Ali am attempting to build a list of every IR Group in the world... groups

The three most useful books for doing a PhD

None of these are accademic.

1. The Not So Short Introduction to L T E X2 ε

2. Eats, Shoots & Leaves

3. Getting things done

ASCII Pikachu

(\___/)
(= ‘.’=)
(”)__(”)

140 Character Web App

Having been inspired by the 140 character webapp challenge, I’ve attempted my own:

<?php if($_GET['a']){$x=file(a);header("Location:$x[0]");fwrite(fopen(a,'w'),$_GET['a']);}?><form><input name=a><input type="submit"></form>

Layed out slightly more readably:

<?php 
  if($_GET['a']){
    $x=file(a);
    header("Location:$x[0]");
    fwrite(fopen(a,'w'),$_GET['a']);
  }
?>
<form>
  <input name=a>
  <input type="submit">
</form>

Hosted at Numenore simply type in a URL, click submit and get sent to the page the previous person left for you.

 
 
miscellaneous.txt · Last modified: 2009/02/22 15:18 by simon
 
Recent changes RSS feed Driven by DokuWiki Page Impressions Valid XHTML 1.0 Valid CSS