This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"".join([chr(ord(l)-(i+1)) for i, l in enumerate("TWSIWTPVSK")]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.extend(jQuery, { | |
"eachIn": function(obj, callback) { | |
var ensureHas = function(key, val) { | |
if (obj.hasOwnProperty(key)) { | |
return callback(key, val); | |
} | |
} | |
return this.each(obj, ensureHas); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl -w | |
### Script for accessing SGD database via www. Produces 2 output files: ### | |
### 1) sgd.txt contains the gene name for the sequence according to SGD ### | |
### 2) blast.txt contains the webpage (html) turned into text ### | |
### Open the file the sequence is in (tab-delimited) ### | |
open SEQ,"<sequence.txt" || die; | |
### Put the file into an array ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> t=tornado.template.Template('<html>{{ bar }}</html>') | |
>>> t.generate() | |
ERROR:root:<string> code: | |
1 def _execute(): | |
2 _buffer = [] | |
3 _buffer.append('<html>') | |
4 _tmp = bar | |
5 if isinstance(_tmp, str): _buffer.append(_tmp) | |
6 elif isinstance(_tmp, unicode): _buffer.append(_tmp.encode('utf-8')) | |
7 else: _buffer.append(str(_tmp)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Colors | |
# The available color codes are: | |
# | |
# a -- black | |
# b -- red | |
# c -- green | |
# d -- brown | |
# e -- blue | |
# f -- magenta | |
# g -- cyan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- simple | |
- public over private | |
- personal vanity | |
- internet is global | |
- permalinks | |
- one important item per page | |
- don't break the browser | |
- don't wanker in technology | |
- a medium is not a grande | |
- break convention for your users |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pmt(start, rate_as_percentage, num_periods, lifetime) { | |
var rate_per_period = ((rate_as_percentage/100) / num_periods); | |
// e.g. num_periods == 12 months, lifetimes = 4 years for 4 years, 12 months per year | |
var total_periods = num_periods * lifetime; | |
var p = (start * rate_per_period * Math.pow((1 + rate_per_period), total_periods)) / (Math.pow((1+rate_per_period), total_periods)-1); | |
console.log(Math.pow((1 + rate_per_period), total_periods)); | |
return p; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/https' | |
require 'uri' | |
SITE_URI = '' | |
SITE_CA = '' | |
USERNAME = '' | |
PASSWORD = '' | |
uri = URI.parse(SITE_URI) | |
http = Net::HTTP.new(uri.host, uri.port) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Originally found here: http://jenders.vox.com/library/post/macports-workaround-for-installing-distcc-31-on-an-intel-mac.html | |
# | |
makefile=/opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/distcc/work/distcc-3.1/Makefile | |
if test -e $makefile; then # user has a half completed installation | |
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
len([]) -> | |
0; | |
len([F|R]) -> | |
len(R,1). | |
len([],A) -> | |
A; | |
len([F|R],A) -> | |
len(R, A+1). |