Skip to content

Instantly share code, notes, and snippets.

View jcsalterego's full-sized avatar

Jerry Chen jcsalterego

View GitHub Profile
#!/usr/bin/env python
import re
import sys
import urllib2
SIZE = "1920x1200"
DOMAIN = "http://interfacelift.com"
URL_FMT = "%s/wallpaper_beta/downloads/date/hdtv/index%%d.html" % DOMAIN
$ python
Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 1 + 2
3
>>> def foo(bar0:
File "<stdin>", line 1
def foo(bar0:
^
$ dig 3rdengine.com mx
; <<>> DiG 9.4.3-P1 <<>> 3rdengine.com mx
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42918
;; flags: qr rd ra; QUERY: 1, ANSWER: 7, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;3rdengine.com. IN MX
def hexhamming(a, b, equal=False):
if not equal:
minl = min(len(a), len(b))
a = a[:minl]
b = b[:minl]
lookup = dict(zip("0123456789abcdef", range(16)))
diffs = 0
for c1, c2 in zip(a, b):
#!/usr/bin/python
import hashlib
import sys
def hamming(a, b):
diffs = 0
for c1, c2 in zip(a, b):
if c1 != c2:
diffmask = ord(c1) ^ ord(c2)
solo
flex
scalable
rubyonrails
rails
cloud
web
hosting
ec2
aws
from pprint import pprint
import re
import sys
import urllib2
URL = "http://www.modifiedcartrader.com/information/newestCars.aspx"
TRANSLATIONS = {(1, "Label1"): "mileage",
(1, "Label2"): "hp",
(1, "Panel1"): "make",
(2, "Label1"): "hp",
# put this in ~/.bash_profile or whatever
python_or_python () {
if [ "$1" == "" ]; then
python
else
python "$@"
fi
}
alias python="python_or_python"
#!/usr/bin/ruby -w
CORPUS = 'magnus.tsv'
RE_SKIPLIST = [ /^\#/,
/^http:/ ]
class Oracle
def initialize(corpus)
@corpus = corpus
end