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
var fs = require('fs'); | |
var input = fs.readFileSync(process.argv[2]).toString().split(/[\n\r]/) | |
, cases = +input[0] | |
, lines = input.slice(1, cases+1); | |
lines.forEach(function(line){ | |
if (!line) return false; |
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
function queue(name){ | |
queue.q[name]++ || (queue.q[name] = 1); | |
return function(err){ | |
if (err && queue.e[name]) queue.e[name](err); | |
else if (err) throw err; | |
process.nextTick(function(){ | |
queue.q[name]--; | |
queue.check(name); | |
}); | |
} |
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
_ = require 'underscore' | |
textA = "hbcxng kbvnnml zwldzxhk rckkxzfk vhnnr mkbsp fntggv mvfvg bcvcztr lgcrt nwdfsx tpg kpd jfh rzlcxqz kdb qgjxk hrcp gbslsh nksnzhb twcgswhf nzlzbj bgnxvv dkwxnx mtnzskdm gxmz ltmjzcx tlppjtrs nxvvzwtf hszj chqf xnrxgt sfn rlgtt vbgwt ghr jfrx lwj trjt gzmmzq bsbkkmn nkw kkfr sblht csgsl stxqhdwr njqzvdfn hppwknf gtxnfv gscmrkn sqwzb hdrswwk tgfqwx psfqsh ghrb crhsd kpkt ghb kplspz hqhr jtgxwtt ztkndjvz vckdt fqxz jbc gfv qlcckl jqnlb bxwd xrpq wmxkj wtt tdfv nfcg dppxqjm kbvnwgsh vzjq nwqsw gwwslh kfrcwfp rppr dmnngst kfkwjv rkzlkvkk jmktljjn scddpv bjbtfd frnk rtvgbrh qlvgcb rzlqhstp lpwwkdgc xjkdq ktq cbnv kmrcqh dngkdsk djsq kljdthx qhgpld bcxdrnmf pczvf kjxlb hzhvg xprfhlwr gztxvx zdwkt rcnnb pfx dlzn wvscbrx tksf pzfp dwjnsd thzhxfs ztnlwgjr rrmgnt xlrv lgws lst pcxv rhlt wqq dpdb ptmv gcr lzr brrgp vsqt znf rjbj drdfwdtt bqkvvqdg jnb dnqjqbs hqpjkkmp dxvcqftf qnmjjg qtbzfj vvk mlxtpr bdnspsmv phkcx ghwrpvb lgk vjc vcz pfbjch vhrpjf spr dkfl jjxnr rlctk xpkpd wvw hgrbqjh |
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
# |
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
var mongoose = require('mongoose') | |
, Schema = mongoose.Schema | |
mongoose.connect('mongodb://localhost/identities'); | |
var IdentitySchema = new Schema({ | |
type : { type: String, enum: ['twitter', 'facebook', 'google'] } | |
, uid : { type: String } | |
}) |
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
proc ue_init {} { | |
lappend d + { } | |
for {set i 0} {$i < 256} {incr i} { | |
set c [format %c $i] | |
set x %[format %02x $i] | |
if {![string match {[a-zA-Z0-9]} $c]} { | |
lappend e $c $x | |
lappend d $x $c | |
} | |
} |
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
<li> | |
<span class="attribute">Accuracy</span> | |
<div class="rating"><span class="filled star_9">4.5 stars</span></div> | |
</li> |
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
input = process.argv.slice(2).join(' ') | |
parseTimeString = (str, debug) -> | |
pattern = /// | |
( # start main group | |
\d+ # digits | |
(?:\s*) # optional spaces | |
( # start unit | |
d (?=ays)? # days |
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
async = require 'async' | |
class Recommender | |
getRecommendations: (search_params, respond) -> | |
# Do 2 things at once: | |
# - check if we have a logged in user, get their info | |
# - fire off distributed requests for search queries | |
# ------------------------------------------------------------------------ |
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
function addEventListener(evt, fn){ | |
window.addEventListener | |
? this.addEventListener(evt, fn, false) | |
: (window.attachEvent) | |
? this.attachEvent('on' + evt, fn) | |
: this['on' + evt] = fn; | |
} |