Skip to content

Instantly share code, notes, and snippets.

View jefftriplett's full-sized avatar
Living the dream

Jeff Triplett jefftriplett

Living the dream
View GitHub Profile
@jefftriplett
jefftriplett / linkedin.sh
Created June 6, 2012 18:09
check to see if your linked in password was compromised via @schmichael
$ curl -s http://schmichael.com/files/LinkedInPasswordHashes.txt.bz2 | bzip2 -cd | grep `python -c 'import hashlib,os;print hashlib.sha1("YOUR LINKEDIN PASSWORD").hexdigest()[5:]'`
# me preferred method:
$ wget http://schmichael.com/files/LinkedInPasswordHashes.txt.bz2
$ cat LinkedInPasswordHashes.txt.bz2 | bzip2 -cd | grep `python -c 'import hashlib,os;print hashlib.sha1("YOUR LINKEDIN PASSWORD").hexdigest()[5:]'`
@jefftriplett
jefftriplett / dbRun.scpt
Created June 8, 2012 23:09
welcome to cloud script
-- http://elasticthreads.tumblr.com/post/1236548752/control-your-mac-from-ios-using-dropbox-and-applescript
on adding folder items to this_folder after receiving this_item
try
--make sure its not a folder
if (this_item as string) does not end with ":" then
run script this_item
end if
end try
end adding folder items to
@jefftriplett
jefftriplett / alice-in-wonderland.md
Created July 18, 2012 19:25
Alice’s Adventures in Wonderland

Alice’s Adventures in Wonderland

by Lewis Carroll

Illustrated by Sir John Tenniel

eBooks@Adelaide
2009

@jefftriplett
jefftriplett / gist:3138275
Created July 18, 2012 19:26
Project Gutenberg's Alice's Adventures in Wonderland

Project Gutenberg's Alice's Adventures in Wonderland, by Lewis Carroll

This eBook is for the use of anyone anywhere at no cost and with almost no restrictions whatsoever. You may copy it, give it away or re-use it under the terms of the Project Gutenberg License included with this eBook or online at www.gutenberg.org

Title: Alice's Adventures in Wonderland

@jefftriplett
jefftriplett / gist:3384083
Last active August 21, 2020 20:55
Tile-Based Games FAQ version 1.2 by Greg Taylor

Tile-Based Games FAQ version 1.2

by Greg Taylor

File : tilefaq.12
Home site: x2ftp.oulu.fi : pub/msdos/programming/docs
Version : 1.2
Released : 4-20-95

Tilefaq 1.2 Copyright 1995 Greg Taylor. All rights reserved.
Appendix I Copyright 1995 Chris Palmer. All rights reserved.

@jefftriplett
jefftriplett / output.txt
Last active October 9, 2015 18:18
uses pip + pypi to see what is upgradeable
$ ./pip.sh outdated
Fabric (1.4.3 != 1.5.1)
gunicorn (0.17.0 != 0.17.2)
$ ./pip.sh install -U gunicorn
Downloading/unpacking gunicorn==0.17.2
Using download cache from /Users/jefftriplett/.pip/download_cache/http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Fg%2Fgunicorn%2Fgunicorn-0.17.2.tar.gz
Running setup.py egg_info for package gunicorn
Installing collected packages: gunicorn
@jefftriplett
jefftriplett / managers.py
Created August 31, 2012 23:11 — forked from epicserve/managers.py
People Manager
from django.db.models import Manager
class ActivePeopleManager(Manager):
def get_query_set(self):
return super(ActivePeopleManager, self).get_query_set().filter(is_active=True)
class StaffPeopleManager(ActivePeopleManager):
@jefftriplett
jefftriplett / gist:3715280
Created September 13, 2012 15:53
Perfect example of why my boss is an asshole. An optimizingly correct and performance tuned asshole.
# example from: http://stackoverflow.com/questions/68630/are-tuples-more-efficient-than-lists-in-python
$ python -m timeit "x=(1,2,3,4,5,6,7,8)"
10000000 loops, best of 3: 0.0571 usec per loop
$ python -m timeit "x=[1,2,3,4,5,6,7,8]"
1000000 loops, best of 3: 0.254 usec per loop
$ python -m timeit -s "x=(1,2,3,4,5,6,7,8)" "y=x[3]"
10000000 loops, best of 3: 0.0758 usec per loop
@jefftriplett
jefftriplett / prettify.py
Created October 30, 2012 14:47
Return a pretty-printed XML string for the Element.
from xml.dom import minidom
from xml.etree import ElementTree
def prettify(elem):
"""
Return a pretty-printed XML string for the Element.
"""
rough_string = ElementTree.tostring(elem, 'utf-8')