Skip to content

Instantly share code, notes, and snippets.

View irskep's full-sized avatar
💭
~emo song lyrics~

Steve Landey irskep

💭
~emo song lyrics~
View GitHub Profile
@irskep
irskep / newpipes.rst
Created December 1, 2011 18:14
Pipes3k

Commands defined and referenced by [ID]: "command in quotes"

After definition, commands may be referenced by ID

Connections defined by reference => reference [=> reference ...]

Expressions are separated by ;

  • file1.txt: one
  • file2.txt: two
@irskep
irskep / stevepipes.rst
Created December 1, 2011 20:29 — forked from timtadh/stevepipes.rst
Pipes3k

Commands defined and referenced by [ID]: "command in quotes"

After definition, commands may be referenced by ID

Connections defined by reference => reference [=> reference ...]

Expressions are separated by ;

  • file1.txt: one
  • file2.txt: two
@irskep
irskep / iterm2_tab_color_aliases.sh
Created June 28, 2012 18:45
bash/zsh aliases for setting iTerm2 tab colors
alias tred='echo -en "\033]6;1;bg;red;brightness;255N^G\a" && echo -en "\033]6;1;bg;green;brightness;128N^G\a" && echo -en "\033]6;1;bg;blue;brightness;128N^G\a"'
alias torange='echo -en "\033]6;1;bg;red;brightness;255N^G\a" && echo -en "\033]6;1;bg;green;brightness;192N^G\a" && echo -en "\033]6;1;bg;blue;brightness;128N^G\a"'
alias tyellow='echo -en "\033]6;1;bg;red;brightness;255N^G\a" && echo -en "\033]6;1;bg;green;brightness;255N^G\a" && echo -en "\033]6;1;bg;blue;brightness;128N^G\a"'
alias tgreen='echo -en "\033]6;1;bg;red;brightness;128N^G\a" && echo -en "\033]6;1;bg;green;brightness;255N^G\a" && echo -en "\033]6;1;bg;blue;brightness;128N^G\a"'
alias tcyan='echo -en "\033]6;1;bg;red;brightness;128N^G\a" && echo -en "\033]6;1;bg;green;brightness;255N^G\a" && echo -en "\033]6;1;bg;blue;brightness;255N^G\a"'
alias tblue='echo -en "\033]6;1;bg;red;brightness;128N^G\a" && echo -en "\033]6;1;bg;green;brightness;128N^G\a" && echo -en "\033]6;1;bg;blue;brightness;255N^G\a"'
alias tmagenta='echo -en "\033]6;1;b
import itertools
import os
from mrjob.parse import is_s3_uri
from mrjob.util import extract_dir_for_tar
def _unique_suffix():
for i in itertools.count():
yield '-mrjob-%d' % i
@irskep
irskep / wfc.py
Created July 17, 2012 04:44
MapReduce word frequency count without mrjob.job
#!/usr/bin/python
"""Counts the frequencies of words in a document, and doubles the count just
for kicks.
Usage:
python -m mrjob.launch wfc.py -r local <input files>
"""
import itertools
INFO:root:Looking up world... 506b84f5c116a451b4000000
INFO:root:World: {u'type': u'forest', u'_id': ObjectId('506b84f5c116a451b4000000'), u'userId': 100002469068875L}
WARNING:requests.packages.urllib3.connectionpool:Retrying (0 attempts remain) after connection broken by 'gaierror(-3, 'Temporary failure in name resolution')': /accounts?ids=100002469068875
ERROR:root:caught exception in handler for /world?id=506b84f5c116a451b4000000 - Traceback (most recent call last):
File "/vagrant/gevvy/gevvy/base.py", line 249, in __call__
handler(self, self.request, self.response)
File "/vagrant/gw/handlers/worlds.py", line 82, in h_world
player = get_user(req.user_id)
File "/vagrant/gw/logic/user.py", line 18, in get_user
return get_users([user_id]).values()[0]
@irskep
irskep / cleanup.sh
Created October 12, 2012 23:51
Delete all local and remote git branches merged to master
# This has to be run from master
git checkout master
# Update our list of remotes
git fetch
git remote prune origin
# Remove local fully merged branches
git branch --merged master | grep -v 'master$' | xargs git branch -d
base:
's.*':
- services
'gw.*':
- gw
'realtime.*':
- realtime
@irskep
irskep / wat.py
Created November 21, 2012 20:00
A mysterious string
u'\xd0\xbd\xd0\xb0\xd0\xb4\xd1\x8f \xd0\xb1\xd0\xb5\xd1\u20ac\xd0\xbb\xd0\xb8\xd0\xbd \xd0\xb2 \xd0\xb4\xd0\xbe\xd0\xbc\xd0\xb0\xd1\u02c6\xd0\xbd\xd0\xb5\xd0\xb9 \xd0\xb0\xd1\u201a\xd0\xbc\xd0\xbe\xd1\x81\xd1\u201e\xd0\xb5\xd1\u20ac\xd0\xb5'
@irskep
irskep / blah.coffee
Last active December 15, 2015 00:39
# NOW:
GW.characters.paths.findPath(world, pathMap, node, start, end)
# PROPOSED:
PF = new GW.characters.paths.Pathfinder(world, pathMap)
PF.findPath(node, start, end)
PF.findPath(node, start2, end2)
PF.canFindPath(node, start, end)
PF.characterCanReachPlot(character, plot)