Skip to content

Instantly share code, notes, and snippets.

View squiter's full-sized avatar

Brunno dos Santos squiter

View GitHub Profile
#!/usr/bin/env node
var COMMIT_FILE = '/Users/felix/pp/commits.csv';
var exec = require('child_process').exec,
fs = require('fs');
exec('git log -1 HEAD --shortstat --pretty=format:"%ai%n%h%n%s"', function (err, stdout, stder) {
if (err) {
throw err;
}
@bkeating
bkeating / howto-filemerge-git-osx.md
Created March 11, 2010 21:36
HOWTO: Using FileMerge (opendiff) with Git on OSX

HOWTO: Using FileMerge (opendiff) with Git on OSX

FileMerge (opendiff) can really come in handy when you need to visually compare merging conflicts. Other times it's just a nice visual way to review your days work.

The following method works by creating a simple bash script (git-diff-cmd.sh) that sets us up with the proper command line arguments for Git to pass off files to FileMerge.

@bitzesty
bitzesty / config.enviroment.rb
Created January 4, 2010 22:58
Getting up and running with MongoDB/MongoMapper
# config/enviroment.rb
config.gem 'mongo'
config.gem 'mongo_mapper'
# remove AR
config.frameworks -= [ :active_record, :active_resource ]
@carlosbrando
carlosbrando / routes.rb
Created December 10, 2009 06:03
A nova DSL de rotas do Rails 3
ActionController::Routing::Routes.draw do |map|
# A prioridade é baseada na ordem da criação:
# criado primeiro -> maior prioridade.
# Exemplo de uma rota comum:
match 'products/:id', :to => 'catalog#view'
# Tenha em mente que você pode atribuir outros valores além de :controller e :action
# Exemplo de uma rota nomeada:
match 'products/:id/purchase', :to => 'catalog#purchase', :as => :purchase
@domwom
domwom / gist:213542
Created October 19, 2009 17:45
php bitly api
function make_bitly_url($url, $login, $appkey, $format='xml', $history=1, $version='2.0.1')
{
//create the URL
$bitly = 'http://api.bit.ly/shorten';
$param = 'version='.$version.'&longUrl='.urlencode($url).'&login='
.$login.'&apiKey='.$appkey.'&format='.$format.'&history='.$history;
//get the url
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $bitly . "?" . $param);
@trey
trey / reset.sass
Created July 31, 2008 20:36
Eric Meyer's reset.css in Sass. Originally by @postpostmodern.
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain) */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,