Skip to content

Instantly share code, notes, and snippets.

View happygiraffe's full-sized avatar
💭
Probably not looking at GitHub…

Dominic Mitchell happygiraffe

💭
Probably not looking at GitHub…
View GitHub Profile
@npryce
npryce / wip.py
Created May 28, 2011 20:17
Decorator to mark tests as work in progress for Python's Nose testing framework
from functools import wraps
from nose.plugins.attrib import attr
from nose.plugins.skip import SkipTest
def fail(message):
raise AssertionError(message)
def wip(f):
@wraps(f)
@DTrejo
DTrejo / top3stories.js
Created January 21, 2011 22:41
Gets top three articles from frontpage and newpage of Hacker News. Blog post on scraping: http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga
// Scraping Made Easy with jQuery and SelectorGadget
// (http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga)
// by David Trejo
//
// Install node.js and npm:
// http://joyeur.com/2010/12/10/installing-node-and-npm/
// Then run
// npm install jsdom jquery http-agent
// node numresults.js
//
@sishen
sishen / Emacs-JSLint
Created January 7, 2011 12:43
Emacs Func: Use ~/bin/jslint4java-1.4.4.jar to automatically JSLint the Javascript file
;;; C-x c calls jslint and outputs to the *compilation* buffer.
(setq jslint-wrapper (concat "java -jar " (substitute-in-file-name "$HOME") "/bin/jslint4java-1.4.4.jar "))
(require 'compile)
(add-hook 'javascript-mode-hook
(lambda ()
(set (make-local-variable 'compilation-read-command) nil)
(set (make-local-variable 'compile-command)
(concat jslint-wrapper buffer-file-name))
(local-set-key (kbd "C-x c") 'compile)))
@garybernhardt
garybernhardt / gist:283992
Created January 22, 2010 18:15
using the git reflog
# I have a repo with two commits
failbowl:temp(master) grb$ git shortlog
Gary Bernhardt (2):
commit 1
commit 2
# I destroy the second commit
failbowl:temp(master) grb$ git reset --hard HEAD^
HEAD is now at 7454aa7 commit 1