Skip to content

Instantly share code, notes, and snippets.

@nicksieger
nicksieger / Send to Evernote.scpt
Created January 1, 2012 23:48 — forked from turadg/Send Chrome to OmniFocus.scpt
OmniFocus integrations
-- from http://veritrope.com/code/copy-omnifocus-item-uri-to-evernote/
tell front window of application "OmniFocus"
try
set theTrees to selected trees of content
if (count of theTrees) < 1 then
set theTrees to selected trees of sidebar
end if
if (count of theTrees) < 1 then
@lukaszb
lukaszb / alaruby.py
Created November 20, 2011 20:39
Ruby-like string interpolation in Python
import sys
import unittest
import jinja2
# sys._getframe works on CPython and PyPy. Not tested elsewhere
rs = lambda text: text.format(**sys._getframe(1).f_locals)
def rj(text):
template = jinja2.Template(text)
@KensoDev
KensoDev / gist:1323026
Created October 28, 2011 18:41
Echo out all of the resque workers on the machine
echo `ps aux | grep [r]esque | grep -v grep | cut -c 10-16`
@KensoDev
KensoDev / gist:1323004
Created October 28, 2011 18:34
Kill all resque workers
sudo kill -9 `ps aux | grep [r]esque | grep -v grep | cut -c 10-16`
@alexbowe
alexbowe / nltk-intro.py
Created March 21, 2011 12:59
Demonstration of extracting key phrases with NLTK in Python
import nltk
text = """The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital
computer or the gears of a cycle transmission as he does at the top of a mountain
or in the petals of a flower. To think otherwise is to demean the Buddha...which is
to demean oneself."""
# Used when tokenizing words
sentence_re = r'''(?x) # set flag to allow verbose regexps
([A-Z])(\.[A-Z])+\.? # abbreviations, e.g. U.S.A.