Skip to content

Instantly share code, notes, and snippets.

View tarnfeld's full-sized avatar

Tom Arnfeld tarnfeld

View GitHub Profile
var a = [], i = 0;
function addPart(part, callback) {
setTimeout(function(part) {
a.push(part);
callback();
}, 200);
};
function init(callback) {
function check() {
@tarnfeld
tarnfeld / error
Created January 2, 2013 11:52 — forked from m4tthumphrey/error
Exception
NoMethodError
Error
undefined method `id' for nil:NilClass
/home/gitlab/gitlab/app/models/project.rb:104:in `find_with_namespace'
/home/gitlab/gitlab/app/workers/post_receive.rb:9:in `perform'
/**
* Live updating API JS client side class
* @author Tim Davies
*/
function LiveupdatingClient (container)
{
/**
* Set up, include handlebars and setup template
*/
var endpoint = 'liveupdating.php';
@tarnfeld
tarnfeld / Answer.php
Created June 7, 2012 15:07 — forked from JeffreyWay/gist:2889230
Simple PHP Quiz
<?php
$string = "January 5th, 2012";
list($month, $day, $year) = array_map(function($v) { return trim($v, ","); }, explode(" ", $string));
var_dump($month, $day, $year);
// string(7) "January"
// string(3) "5th"
// string(4) "2012"
@tarnfeld
tarnfeld / blog.php
Created February 21, 2011 07:29 — forked from dhrrgn/blog.php
<?php
class Controller_Blog extends Controller {
/**
* This is a simple example, the class does not exist. There are much more
* things you would be able to do, this is just an example.
*
* Yes, I know this is all (kind of) currently possible, but this encapsulates
* the response and allows for nice things like advanced response caching.
<?php
include 'config.php';
// This should go in your config.php ^^
define('BASEPATH', dirname(__FILE__));
// Also, convention is capitals for constants
define('NAME', "Tom");
function tint($tinty){