Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am curiousstranger on github.
  • I am curiousstranger (https://keybase.io/curiousstranger) on keybase.
  • I have a public key ASC2juss3BGloYtC_2rOQy7Ynvr6nYidKXnyZCdaJTlDVQo

To claim this, I am signing this object:

View gdocs_values.py
from evesrp.killmail import ZKillmail
import gdata.spreadsheets.client
from decimal import Decimal
# patch the spreadsheet's client to use the public feeds
gdata.spreadsheets.client.PRIVATE_WORKSHEETS_URL = \
gdata.spreadsheets.client.WORKSHEETS_URL
gdata.spreadsheets.client.WORKSHEETS_URL = ('https://spreadsheets.google.com/'
'feeds/worksheets/%s/public/full')
View live-command-coloring.sh
#!/usr/bin/env zsh
# ------------------------------------------------------------------------------
# Fish style live command coloring.
# ------------------------------------------------------------------------------
# Token types styles.
# See http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#SEC135
ZLE_RESERVED_WORD_STYLE='bold'
ZLE_ALIAS_STYLE='bold'
ZLE_BUILTIN_STYLE='bold'
@curiousstranger
curiousstranger / gist:339011
Created Mar 21, 2010
Search for a pattern in a file with python
View gist:339011
# Open file
f = open('test.txt', 'r')
# Feed the file text into findall(); it returns a list of all the found strings
strings = re.findall(r'some pattern', f.read())
@curiousstranger
curiousstranger / gist:309035
Created Feb 19, 2010
Unlock osx keychain from the command line. Must approve access via 'Keychain Access' before using
View gist:309035
security unlock-keychain; security find-generic-password -ga /Users/mruser/.ssh/id_dsa 2>&1 > /dev/null
@curiousstranger
curiousstranger / mac1to3
Created Feb 4, 2010
On OS X, transform MAC format
View mac1to3
#!/bin/sh
#
# Grabs MAC addresses in XXXXXXXXXXXX form from the clipboard and transforms it to xxxx.xxxx.xxxx
pbpaste -Prefer txt | perl -pe 's/(\w{4})(\w{4})(\w{4})/\1.\2.\3/;' | pbcopy
@curiousstranger
curiousstranger / mac3to1
Created Feb 4, 2010
Script to convert mac address on clipboard between formats
View mac3to1
#!/bin/sh
#
# Grabs MAC addresses in xxxx.xxxx.xxxx form from the clipboard and transforms it to XXXXXXXXXXXX
pbpaste -Prefer txt | perl -pe 's/(\w{4}).(\w{4}).(\w{4})/\U\1\2\3/;' | pbcopy
View Evolution of a Python programmer.py
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal