Skip to content

Instantly share code, notes, and snippets.

@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:

@xaviershay
xaviershay / http_client_spec.rb
Created December 13, 2011 02:19
Running a rack app in a thread for integration tests.
require 'integration_helper'
require 'rack'
require 'rack/handler/webrick'
describe HttpClient do
before :all do
@server = WEBrick::HTTPServer.new(
:Port => 9293,
:Logger => Rails.logger,
:AccessLog => Rails.logger
@ayust
ayust / .gitconfig
Created September 8, 2011 11:28 — forked from tekkub/gist:1203061
Git aliases to prune merged branches
[alias]
prunelocal = !sh -c 'git branch --merged | grep -v "^*" | xargs git branch -d'
pruneorigin = prune-remote origin
##################
# Helper aliases #
##################
# prune-remote <remote name>
require 'rubygems'
require 'redis'
$redis = Redis.new()
$redis.select(3)
# do a zdiffstore only on scores that match
# ie [23:12345] will only be removed by [23:12345], not [23:12350]
def zdiffstore(x, y)
$redis.zunionstore "tmp.zu", [x, y], :weights=>[1,-1], :aggregate=>:sum
@gravis
gravis / readme
Created September 26, 2010 17:26
tcp syslog logger for rails draft
tcp_syslog is now a gem :
https://github.com/tech-angels/tcp_syslog
@agile
agile / compact_progress_bar_formatter.rb
Created September 17, 2010 13:44
Nice progress bar and immediate feedback for failures, pending and slow specs
# Copyright (c) 2008 Nicholas A. Evans
# http://ekenosen.net/nick/devblog/2008/12/better-progress-bar-for-rspec/
#
# With some tweaks (slow spec profiler, growl support)
# By Nick Zadrozny
# http://gist.github.com/71340
#
# Further tweaks (formatador, elapsed time instead of eta)
# By geemus (Wesley Beary)
# http://gist.github.com/266222