This file contains hidden or 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
# gief_new_branch <new_branch> [<start_point>] | |
# fetch 'upstream' named remote and branch out from 'upstream'/<start_point> | |
# git fetch upstream && git checkout -b <new_branch> upstream/[<start_point>] | |
function gief_new_branch() | |
{ | |
local EFG="\033[0;31m" | |
local QFG="\033[32m" | |
local NC="\033[0m" | |
echo -e "${EFG}" |
This file contains hidden or 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
# related parts of motor.DataServer suggestion | |
# something along the lines of... | |
class DataServer(object): | |
@tornado.gen.engine | |
def stream(self, handler, file_id): | |
fs = yield motor.Op(motor.MotorGridFS(db).open) | |
try: | |
gridout = yield motor.Op(fs.get, file_id) |
This file contains hidden or 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
<script type="text/javascript"> | |
jQuery(document).ready(function() { | |
$('#autocomplete').typeahead({ | |
source: someDataSource | |
, matcher: function (item) { | |
queryItems = this.query.toLowerCase().split(/, */); | |
queryLast = queryItems[queryItems.length-1]; | |
return ~item.toLowerCase().indexOf(queryLast) | |
} |
This file contains hidden or 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
# procrastination adventures | |
''' | |
RESULTS: (over 1m iterations) | |
Python 2.5 | Python2.6 | Python3.1 | |
test1: ~17.5s | ~14.6s | ~22.1s | |
test2: ~10.6s | ~10.3s | ~16.2s | |
just_join: ~0.7s | ~0.66s | ~0.63s | |
just_sample: ~10.5s | ~9.75s | ~15.7s | |
just_str: ~3.45s | ~3.1s | ~3.4s | |
''' |
NewerOlder