Skip to content

Instantly share code, notes, and snippets.

View millermedeiros's full-sized avatar

Miller Medeiros millermedeiros

View GitHub Profile
@sjl
sjl / ffind.md
Created September 19, 2012 21:52
friendly-find

friendly-find

Brainstorming a friendlier find(1).

Usage

Goals:

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

@dherman
dherman / emacs-cheat-sheet.md
Created August 2, 2012 16:22
My emacs cheat sheet

In penance for cracking stupid jokes on Twitter, here's my Emacs cheat sheet. Emacs has a steep learning curve, so I've tried to order them by importance so you could learn them in stages.

One overall rule of thumb: pay attention to the minibuffer (the line at the bottom of the editor). It will often guide you through a process, and also gives you hints about what state you're in, such as the middle of a multi-chord sequence.

The other rule of thumb: when in doubt, C-g it out.

Basics (mandatory)

You simply can't get by without having these at your fingertips.

@leobetosouza
leobetosouza / gist:2856498
Created June 2, 2012 04:00
JavaScript Design Patterns Hangout
Links, livros, artigos e etc comentados durante o Hangout 'JavaScript e Design Patterns': http://youtu.be/FkED71eM7s8
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@bga
bga / [fun] various forms of ternary operator in JavaScript.js
Created March 7, 2012 15:10
[fun] various forms of ternary operator in JavaScript
// add your variants of
a ? b : c
// in comments :)
// a is boolean
// b and c - any type
// lazy evaluation isnt important
@briancavalier
briancavalier / promisify.js
Created February 24, 2012 13:03
Turn callback-based functions into promise-based functions
var when = require('../when');
// A test callback-based function
function callbackBased(value, callback, errback) {
setTimeout(function() {
(value ? callback : errback)(value);
}, 100);
}
function log(val) {
@tbranyen
tbranyen / use.js
Created January 13, 2012 01:21
A RequireJS compatible plugin to provide shimming capabilities declaratively.
(function() {
var buildMap = {};
/* RequireJS Use Plugin v0.2.0
* Copyright 2012, Tim Branyen (@tbranyen)
* use.js may be freely distributed under the MIT license.
*/
define({
version: "0.2.0",