Skip to content

Instantly share code, notes, and snippets.

View tarnfeld's full-sized avatar

Tom Arnfeld tarnfeld

View GitHub Profile
//## SCROLL ##//
function sTo(sel){
var v = 0;
if (sel.index() == 0) v = - 31;
$('#full').animate({scrollTop: sel.offset().top - v},'slow');
}
var start = $('.set[data-hash="' + window.location.hash + '"]');
if (start.length > 0) {
sTo(start);
<?php
// First off, change
public function __construct($table, $id) ..
// to
public function __construct($table, $id = null) ..
// then only use the $id part if its not null
@tarnfeld
tarnfeld / gist:1293169
Created October 17, 2011 17:24
Magicload class
<?php
class Magicload {
protected static $_data = array();
/**
* The index action.
*
* @access public
@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}}
<?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(
<?php
class Controller_Post extends \Controller_Template
{
public $template = 'templates/page';
public function action_index()
{
\Response::redirect("/");
@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 .
@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
begin
require "rainbow"
rescue LoadError => e
# Lets not worry about this
end
module Snowey
module Logger
module Thing
def say_message string
self.message = string
self.say
end
module_function :say_message
def message= string