Skip to content

Instantly share code, notes, and snippets.

View aubricus's full-sized avatar
Coffee.

Aubrey Taylor aubricus

Coffee.
View GitHub Profile
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@zenkay
zenkay / gist:3237860
Created August 2, 2012 15:19
Installation tips for RVM/Ruby on OSX 10.8 Mountain Lion

Ruby, RVM and Mountain Lion

Key problems

Mountain Lion (10.8) has three main difference compared to Lion (10.7):

  • XCode 4.4 does not install Command Line Tools by default
  • X11 isn't available anymore
  • The installed version of OpenSSL has some bugs

How to work around

@brubrant
brubrant / get-sprite.scss
Created July 23, 2012 23:20 — forked from dfadler/get-sprite.sass
A SASS (SCSS) mixin for generating a sprite declaration block that will work with media queries
// http://compass-style.org/reference/compass/helpers/sprites/
@mixin get-sprite($map, $sprite, $repeat: no-repeat, $height: true, $width: true) {
//http://compass-style.org/reference/compass/helpers/sprites/#sprite-file
$sprite-image: sprite-file($map, $sprite);
// http://compass-style.org/reference/compass/helpers/sprites/#sprite-url
$sprite-map: sprite-url($map);
// http://compass-style.org/reference/compass/helpers/sprites/#sprite-position
@davidmarble
davidmarble / patch_model.py
Created November 28, 2011 21:02
Monkey patch django built-in models so that any fields can be overwritten or added
from django.db.models.fields import Field
import types
def patch_model(model_to_patch, class_to_patch_with):
"""
Adapted from http://www.ravelsoft.com/blog/2010/patchmodel-hacky-solution-extending-authuser-class
Monkey patch a django model with additional or replacement fields and methods.
All fields and methods that didn't exist previously are added.
@JeffreyWay
JeffreyWay / gist:1374162
Created November 17, 2011 19:22
Prompt IE6 for Chrome Frame Install
<!--[if lt IE 7 ]>
<script src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
<script>CFInstall.check();</script>
<![endif]-->
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@optilude
optilude / Default (OS X).sublime-keymap - User
Created August 8, 2011 19:26
A version of the Sublime Text 2 plugin at http://www.sublimetext.com/forum/viewtopic.php?f=5&t=2260&start=0 that makes for TextMate-like clipboard history
[
{ "keys": ["super+x"], "command": "clipboard_history_cut" },
{ "keys": ["super+c"], "command": "clipboard_history_copy" },
{ "keys": ["super+v"], "command": "clipboard_history_paste" },
{ "keys": ["super+shift+v"], "command": "clipboard_history_previous_and_paste" },
{ "keys": ["super+pagedown"], "command": "clipboard_history_next" },
{ "keys": ["super+pageup"], "command": "clipboard_history_previous" },
{ "keys": ["super+alt+ctrl+v"], "command": "clipboard_history_choose_and_paste" }
@drewwells
drewwells / core.test.js
Created April 14, 2011 20:21
RequireJS and QUnit sitting in a tree
//Wait for relevant code bits to load before starting any tests
define(['core.js'], function( core ) {
module("Core Tests");
test("Test core methods", function(){
expect(2);
equals( 1, 1, "A trivial test");
ok( true, "Another trivial test");
});