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
> db.foo.aggregate([{$unwind: '$sub'}, {$match: {start: {$lte: 3}, end: {$gte: 6} }}]) | |
{ | |
"result" : [ | |
{ | |
"_id" : ObjectId("522da57d186b82d5279cb35c"), | |
"start" : 3, | |
"end" : 6, | |
"sub" : { | |
"start" : 3, | |
"end" : 6 |
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
#!/usr/bin/python | |
import sys | |
from collections import Counter | |
try: | |
with open(sys.argv[1], 'r') as f: | |
c = Counter(l.rstrip('\r\n') for l in f.readlines()) | |
except IndexError: | |
print "Usage: ./count.py [infile]" | |
except IOError: |
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
#!/usr/bin/python | |
import sys | |
from collections import Counter | |
try: | |
with open(sys.argv[1], 'r') as f: | |
c = Counter(l.rstrip('\r\n') for l in f.readlines()) | |
except IndexError: | |
print "Usage: ./count.py [infile]" | |
except IOError: |
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
set: function (collection) { | |
// returns a set (as a list...) from a collection | |
// in other words, uniques | |
var o = {}, r = [], l = collection.length, i = 0; | |
for (; i < l; i++) { | |
if (!(collection[i] in o)) { | |
o[collection[i]] = true; | |
r.push(collection[i]); | |
} | |
} |
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
unique_bind: function (els, e, lambda) { | |
// binds an event function to an element or set of elements | |
// but only if the event is not already registered on the element | |
$.LS.Log('onetime binding {0} els'.format(els.length)); | |
$.each(els, function (ix, el) { | |
var x = $._data($(el).get(0), 'events'); | |
if (typeof x === 'undefined' || x[e] === 'undefined') { | |
$(el).bind(e, function (event) { | |
lambda(); | |
}); |
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
> ~ dig @8.8.8.8 a spode.me | |
; <<>> DiG 9.8.5-P1 <<>> @8.8.8.8 a spode.me | |
; (1 server found) | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21871 | |
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 | |
;; QUESTION SECTION: |
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
g++ `pkg-config --cflags --libs opencv` ./libopencv_facerec.a -o out facerec.cpp -I ../include -lopencv_core -lopencv_highgui -lopencv_imgproc |
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
//-------------------------------------------------------------------------------------------------- | |
// | |
// stage 2 of 3 | |
// | |
// challenge: | |
// reveal the solution within VM.mem | |
// | |
// disclaimer: | |
// tested in ie 9, firefox 6, chrome 14 and v8 shell (http://code.google.com/apis/v8/build.html), | |
// other javascript implementations may or may not work. |
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
{ | |
"action": "search", | |
"result": true, | |
"data": [{ | |
"oid": "10412366819", | |
"can_view": false, | |
"looking_for_type_id": [1, 2, 3, 4, 5], | |
"familystatus_": 0, | |
"sexuality_": 1, | |
"smoker_": 0, |
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
> ~ curl -H 'content-type: multipart/form-data; boundary=55e83917fc41113113c39888e4954' https://ed.uniformdating.com/mobile_application.php\?action\=login -X POST --data-binary @ud.txt | |
{ | |
"action": "login", | |
"result": true, | |
"data": { | |
"oid": "10741323098", | |
"looking_for_type_id": [], | |
"familystatus_": 1, | |
"sexuality_": 1, |