Skip to content

Instantly share code, notes, and snippets.

View SimonS's full-sized avatar

Simon Scarfe SimonS

View GitHub Profile

Keybase proof

I hereby claim:

  • I am simons on github.
  • I am simonscarfe (https://keybase.io/simonscarfe) on keybase.
  • I have a public key ASDdpGcNKiO5TfDBps17wf4TCnXIYXTYVbLEhH3pJdY1KAo

To claim this, I am signing this object:

@SimonS
SimonS / .block
Last active February 9, 2018 16:04
fresh block
license: mit
@SimonS
SimonS / .block
Created November 13, 2017 10:49
fresh block
license: mit
@SimonS
SimonS / .block
Last active October 3, 2017 23:16
fresh block
license: mit
@SimonS
SimonS / .block
Created October 3, 2017 23:01
fresh block
license: mit
@SimonS
SimonS / streak_stats.php
Last active January 1, 2016 19:28
Hacking around my streak with the dailymile API
<?php
require 'vendor/autoload.php';
$client = new DailymilePHP\Client;
$entries = $client->getEntries(['username' => 'simons', 'page' => 'all', 'since' => '1325462400']);
echo 'Entries: ' . count($entries). "\n";
$runningEntries = array_filter($entries, function($entry) {
@SimonS
SimonS / mentions.action
Created December 21, 2012 12:22
Use Growl to allow notifications in DMDirc on OS X
# pre-requisites:
# growlnotify (found as part of the Extras folder in the Growl distribution)
# DMDirc redirect plugin
# DMDirc exec plugin
# This section indicates which sections below take key/value
# pairs, rather than a simple list. It should be placed above
# any sections that take key/values.
keysections:
condition 0
@SimonS
SimonS / gist:2001962
Created March 8, 2012 16:35
Minimal reponsive javascript framework
(function($){
var previous_state = '',
state;
$(function(){
// Resize event
var resizeTimer = null; /* use resizeTimer to minimise lag */
$(window).resize( function(){
@SimonS
SimonS / gist:2000649
Created March 8, 2012 11:47
Simple autoloader, customised the Zend autoloader to work with wordpress parent & child themes. Tries Parent and then fallsback to child. Could easily be reversed.
function __autoload($class_name) {
$parent_path = realpath(dirname(__FILE__).'/'.str_replace("_", "/", $class_name).'.php');
if(file_exists($parent_path)) {
require_once $parent_path;
}
$child_path = realpath( get_stylesheet_directory() . '/class/'. str_replace("_", "/", $class_name).'.php' );
if(file_exists($child_path)) {
require_once $child_path;
}
@SimonS
SimonS / wp_create.sh
Created March 8, 2012 11:02
quick start wordpress script
DEST=$1
WP='http://wordpress.org/latest.tar.gz'
wget $WP
tar zxvf latest.tar.gz
mv wordpress $DEST
rm latest.tar.gz
cd $DEST