Skip to content

Instantly share code, notes, and snippets.

@Geraint
Geraint / demo.php
Created June 28, 2012 09:57
Immediately Invoked Function Expression in PHP
call_user_func(function($arg1, $arg2) {
// do stuff
}, $arg1, $arg2);
@Geraint
Geraint / test
Last active October 2, 2015 03:08
Eclipse Template - PHPUnit Test
class ${class_name}Test extends PHPUnit_Framework_TestCase
{
/**
* @test
*/
public function ${method_name}()
{
${cursor}
}
}
@Geraint
Geraint / phpunit
Last active October 2, 2015 03:08
Eclipse Template - PHPUnit
class ${class_name}Test extends PHPUnit_Framework_TestCase
{
/** @test */
public function ${method_name}()
{
${cursor}
}
}
@Geraint
Geraint / README.md
Last active September 29, 2017 00:07
Installing SASS/Compass on Windows via Cygwin

Install Cygwin & Ruby

Follow the instructions at http://cygwin.com/install.html. You will run an executable called setup.exe which will guide you through the installation. You will eventually arrive at a screen where you can select the packages you want to install. Be sure to install Ruby (its under Interpreters/ruby).

Once Cygwin has finished installing packages, it will offer to create icons for you. You can click on these icons to start up a terminal session, so select what ever is convenient for you.

Once installation is complete, start a terminal session.

Confirm that ruby is installed by typing this at the prompt:

@Geraint
Geraint / client.html
Created December 6, 2011 15:12
Responsive Images with node.js
<!doctype html>
<html>
<head>
<script>
var uri = 'http://localhost:1337/?width=' + window.innerWidth;
document.write('<script src="' + uri + '"><\/script>');
</script>