This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{'query': {'bool': {'must': | |
[{'field': | |
{'abstract': | |
{'query': 'Kyle AND "body odor"'}}}, | |
{'field': | |
{'title': | |
{'query': 'heat OR wave'}}}]}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def report_memory_leaked(f): | |
""" Counts objects allocated in memory before and after the | |
decorated function and reports the results. If you decorate | |
a function like | |
@report_memory_leaked | |
def myfunc(): | |
pass # do stuff | |
It will report objects by type that were leaked or created. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python | |
from google.appengine.api import mail | |
from google.appengine.api import urlfetch | |
try: | |
import json | |
except ImportError: | |
try: | |
import simplejson as json | |
except ImportError: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HighBaseEncoder(object): | |
"""docstring for HighBaseEncoder | |
http://stackoverflow.com/questions/1119722/base-62-conversion-in-python | |
""" | |
def __init__(self): | |
super(HighBaseEncoder, self).__init__() | |
ALPHABET = "23456789abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make a new virtual env | |
# named ninjakitten | |
mkvirtualenv ninjakitten | |
cdvirtualenv | |
# Install readline binary | |
easy_install -a readline | |
# Install ipython | |
pip install -E . ipython |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
fingerprint_cluster.py | |
Based on http://code.google.com/p/google-refine/wiki/ClusteringInDepth | |
Created by Kyle Jensen on 2010-12-15. | |
""" | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autoload -Uz vcs_info | |
zstyle ':vcs_info:*' check-for-changes true | |
zstyle ':vcs_info:*' enable git svn hg | |
### git: Show marker (T) if there are untracked files in repository | |
# Make sure you have added staged to your 'formats': %c | |
function +vi-git-untracked(){ | |
if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' ]] && \ | |
git status --porcelain | grep '??' &> /dev/null ; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GITX="/Applications/GitX.app/Contents/Resources/gitx" | |
if [[ -x $GITX ]]; then | |
gitx() { | |
if [[ ($# -eq 1) && ($1 != "-"*) ]]; then | |
# If a single arg is given, assume that | |
# arg is the directory to open. | |
$GITX --git-dir=$1 | |
else | |
# Otherwise pass args to gitx. | |
$GITX "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
########################################################## | |
# | |
# This is a shell script for keeping a journal that is | |
# * plaintext, | |
# * time-stamped, | |
# * encrypted, and | |
# * edited with vim. | |
# |
OlderNewer