Skip to content

Instantly share code, notes, and snippets.

View tarnfeld's full-sized avatar

Tom Arnfeld tarnfeld

View GitHub Profile
@tarnfeld
tarnfeld / README.md
Created April 9, 2012 22:26
Riak Bootstrap for Ubuntu 11.10

Riak Bootstrap for Ubuntu 11.10

Fire up a new Ubuntu 11.10 instance (I'm using EC2 for this) and log in. Move into the home directory (you should be there already at login) and run the following command to bootstrap this instance and get riak up and running.

$ curl -0 https://raw.github.com/gist/2347065/riak-bootstrap.sh | sh
<?php
function diff($hours, $minutes)
{
// get the degrees for each part
$hour_deg = 360/12;
$min_deg = 360/60;
// calculate the position
$hour_hand = $hour_deg*$hours;
module Thing
def say_message string
self.message = string
self.say
end
module_function :say_message
def message= string
begin
require "rainbow"
rescue LoadError => e
# Lets not worry about this
end
module Snowey
module Logger
@tarnfeld
tarnfeld / MMPageViewController.h
Created February 25, 2012 12:56
View controller rotation for page view controller child view controllers
#import <UIKit/UIKit.h>
@interface MMPageViewController : UIPageViewController
@end
@tarnfeld
tarnfeld / gist:1863262
Created February 19, 2012 11:27
Diff a remote branch against a local branch
# Fetch from the remote
git fetch {remote}
# List remote branches
git branch -r
# Find the branch labeled {remote}/branchname you want to diff
# Diff it
git diff {remote}/branch .
<?php
class Controller_Post extends \Controller_Template
{
public $template = 'templates/page';
public function action_index()
{
\Response::redirect("/");
<?php
// Load in the Autoloader
require COREPATH.'classes'.DIRECTORY_SEPARATOR.'autoloader.php';
class_alias('Fuel\\Core\\Autoloader', 'Autoloader');
// Bootstrap the framework DO NOT edit this
require COREPATH.'bootstrap.php';
Autoloader::add_classes(array(
@tarnfeld
tarnfeld / notes.txt
Created February 5, 2012 16:40
This is a test blarh
tweetbot post data:
POST: {"source":"Tweetbot for iPhone","message":"Jhf"}
FILES: {"media":{"name":"image.jpg","type":"image\/jpeg","tmp_name":"\/tmp\/phpkLnjR9","error":0,"size":79908}}
@tarnfeld
tarnfeld / gist:1293169
Created October 17, 2011 17:24
Magicload class
<?php
class Magicload {
protected static $_data = array();
/**
* The index action.
*
* @access public