Skip to content

Instantly share code, notes, and snippets.

@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>
@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 / 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 / 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 / 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 / class
Created September 3, 2013 13:14
Eclipse Template - PHP Class
/**
* Holds definition of ${class_name}
* @package ${package_name}
*/
/**
* ${class_description}
* @package ${package_name}
*/
class ${class_name}
@Geraint
Geraint / getset
Last active December 22, 2015 07:38
Eclipse Template - getset
/** @var ${type} */
private $$${property};
/**
* Returns the ${property} value.
*
* @return ${type}
*/
public function get${propertyCapital}()
{
@Geraint
Geraint / sudoers
Last active December 26, 2015 17:38
trying to figure out sudoers syntax
User_List Host_list = (Run_As) Cmnd_Spec_List
%wheel ALL = (ALL) ALL
jenkins slave.local = (backup_user) NOPASSWD: /path/to/backup.sh
@Geraint
Geraint / tmux-cheatsheet.md
Last active December 29, 2015 20:29
Cheat-sheet for tmux

tmux Cheat Sheet

Session management

Creating sessions

  • tmux - creates a new session
  • tmux new-session - also creates a new session
  • tmux new-session -s foo - creates a new session named foo
  • tmux new -s foo - also creates a new session named foo
@Geraint
Geraint / vim-cheatsheet.md
Last active July 15, 2020 21:46
Cheat sheet for vim

Vim Cheat Sheet

Movement

By "Word"

  • w forward to beginning of the next word
  • W forward to beginning of the next word (whitespace separates)
  • e forward to end of next word
  • E forward to end of next word (whitespace separates)
  • b back to beginning of the previous word