Skip to content

Instantly share code, notes, and snippets.

View jakebiesinger's full-sized avatar

Jake Biesinger jakebiesinger

  • University of California, Irvine
  • Queen Creek, Arizona
View GitHub Profile
@jakebiesinger
jakebiesinger / gist:6349778
Last active December 21, 2015 18:49
Terminal prompt showing random, green happy unicode faces or angry red faces, depending on the exit code.
# emoticon version :) :(
export PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \`if [ \$? = 0 ]; then echo -e '\[\e[01;32m\]:)'; else echo -e '\[\e[01;31m\]:( ('$?')'; fi\` \[\033[00m\]\n\$ "
# simple unicode version ¬_¬ 😱
export PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \`if [ \$? = 0 ]; then echo -e '\[\e[01;32m\]¬_¬'; else echo -e '\[\e[01;31m\]😱 ('$?')'; fi\` \[\033[00m\]\n\$ "
# randomly selected smiles / frowns... see more at http://wrttn.me/30dbfd/
smiles="¬_¬
(^o^)
@jakebiesinger
jakebiesinger / Jacob-Biesinger-public-key
Last active December 21, 2015 03:39
My GPG Public key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: OpenPGP.js v.1.20130712
Comment: http://openpgpjs.org
xsBNBFINLngBCACTfqW1ZsIPtaBCeXGQ+KuG66wBCTVNodqhY5P292sekYOG
1ldjADX1bO/T88nqQlBgJi/gwzOb9dDkD/MXjcdX3buJS+oiPsHdG9+v34Xq
owZCbZP4XAHC3epXkpN/K/kMdjY5mPorakeP4eXWKT3XfKwhe/GoZ3eXcxaH
tfGIK1M055fBCQIuOusgMf55dbsfg9QyzTbXZciP0x9PuUvrd3TaYpebBmYq
cTc0Z44feQevj+/GQxh8Il4i+eJF1mpa1gzVbAKfnAXu1zxqOuHIwfbaKlgM
f32fXFC17ya/2ZQ7wkme/E2XOTrSjuSYLj5hewDccYat+T9dtaZRfFWjABEB
@jakebiesinger
jakebiesinger / parseFastq.py
Created December 29, 2010 20:20
Simple parser for fastq file format
from itertools import ifilter, islice
def readFastq(fastqfile):
"parse a fastq-formatted file, yielding a (header, sequence, quality) tuple"
fastqiter = (l.strip('\n') for l in fastqfile) # strip trailing newlines
fastqiter = ifilter(lambda l: l, fastqiter) # skip blank lines
while True:
fqlines = list(islice(fastqiter, 4))
if len(fqlines) == 4:
header1,seq,header2,qual = fqlines