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
127.0.2.1 proxy.need4moredev.api.oneall.com |
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
spencersr@buckaroobanzai:~$ python test1.py | |
1 | |
1.5 |
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/env python | |
# -*- coding: UTF-8 -*- | |
import os | |
import sys | |
import pprint | |
import base64 | |
import urllib | |
import json |
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/env python | |
import sys | |
import struct | |
import itertools | |
from PIL import Image | |
im = Image.open(sys.argv[1]) |
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
tornado.escape.native_str( | |
base64.urlsafe_b64encode( | |
tornado.escape.utf8( | |
tornado.escape.native_str( | |
'http://someyummy.url/cupcake' | |
) | |
) | |
) | |
) |
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
spencersr@buckaroobanzai:~/Projects/AllYourDatabase/Example$ find -L Location -print0 | xargs -0 ls -idH | sort -k 2 | sed 's|Location/Continent/North America/Country/United States of America/State/|.../|' | grep "Alaska" | sort -k 2 | |
985554 .../Alaska | |
985556 .../Alaska/County | |
985557 .../Alaska/County/Anchorage Municipality | |
985558 .../Alaska/County/Anchorage Municipality/Community | |
985561 .../Alaska/County/Anchorage Municipality/Community/Anchorage | |
985701 .../Alaska/County/Anchorage Municipality/Community/Anchorage/Neighborhood | |
985623 .../Alaska/County/Anchorage Municipality/Community/Anchorage/Neighborhood/Campbell | |
985821 .../Alaska/County/Anchorage Municipality/Community/Anchorage/Neighborhood/Campbell/Postal Code | |
985721 .../Alaska/County/Anchorage Municipality/Community/Anchorage/Neighborhood/Campbell/Postal Code/99518 |
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
MongoDB shell version: 2.4.3 | |
connecting to: test | |
Initial Document | |
{ | |
"_id": ObjectId( | |
"51a64dafc29659cc0732ec75") | |
} | |
Adding in a post | |
Modified Document | |
{ |
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.places.aggregate({ '$match': { 'dns': /^anchorage.alaska/ }}, {'$group' : { _id: {dns: '$dns', importance: "$importance", level: "$level"}, geohashes: { $addToSet: '$geohash' }}}, {'$sort': { "_id.level": -1, "_id.importance": -1} }) | |
{ | |
"result" : [ | |
{ | |
"_id" : { | |
"dns" : [ | |
"anchorage.anchorage.alaska", | |
"anchorage.alaska", | |
"anchorage.anchorage.ak", | |
"anchorage.ak" |
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
# below be a geohash | |
>>> geohash.encode(64, -141, precision=8) | |
'bg7sp6yg' | |
# Below be radians | |
>>> geohash.decode_exactly(geohash.encode(64, -141, precision=8))[-1] | |
0.000171661376953125 | |
>>> geohash.decode_exactly(geohash.encode(64, -141, precision=7))[-1] | |
0.0006866455078125 | |
>>> geohash.decode_exactly(geohash.encode(64, -141, precision=6))[-1] |
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
class BaseHandler(tornado.web.RequestHandler): | |
# ... | |
@tornado.gen.coroutine | |
def verify_place_something(self): | |
motor_db = self.settings['motor_db'] | |
cursor = motor_db.places.find( |