Skip to content

Instantly share code, notes, and snippets.

View alecthomas's full-sized avatar
😀

Alec Thomas alecthomas

😀
View GitHub Profile
@alecthomas
alecthomas / console_log_call_stack.js
Created March 22, 2013 20:24
Javascript console.log() with collapsed call stack
if (typeof console !== undefined) {
console.logJack = console.log;
console.log = function(){
console.groupCollapsed.apply(console, arguments);
console.logJack(new Error().stack);
console.groupEnd();
};
}
@jugyo
jugyo / file_name_on_status_bar.py
Created February 26, 2013 07:41
Sublime Text Plugin to show file name on status bar
import sublime_plugin
class FileNameOnStatusBar(sublime_plugin.EventListener):
def on_activated(self, view):
path = view.file_name()
if path:
for folder in view.window().folders():
path = path.replace(folder + '/', '', 1)
view.set_status('file_name', path)
else:
@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: