A demo of Mike Bostock’s TopoJSON using states & provinces boundaries from Natural Earth.
With simplification turned on (-s 100
), this reduces the original 57MB GeoJSON file to a mere 515KB!
A demo of Mike Bostock’s TopoJSON using states & provinces boundaries from Natural Earth.
With simplification turned on (-s 100
), this reduces the original 57MB GeoJSON file to a mere 515KB!
import os | |
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' #not using env.put as that does not execute immediately | |
from django.conf import settings | |
SessionStore = __import__(settings.SESSION_ENGINE, fromlist=['']).SessionStore | |
class DjangoSessionWSGIMiddleware(object): | |
transform = false #doesn't transform output of anything above in the stack | |
def __init__(self, app): | |
self.app = app |
function p --description 'Start the best Python shell that is available' | |
set -l cmd | |
if test -f manage.py | |
if pip freeze ^/dev/null | grep -q 'django-extensions' | |
set cmd (which python) manage.py shell_plus | |
else | |
set cmd (which python) manage.py shell | |
end | |
else |
from collections import deque | |
from functools import wraps | |
def inversify(predicate): | |
"""Returns a predicate that is the inverses of the given predicate.""" | |
@wraps(predicate) | |
def _inner(*args, **kwargs): | |
return not predicate(*args, **kwargs) | |
return _inner |
var landGrid = [ | |
{ | |
"X": "1", | |
"Y": "1" | |
}, | |
{ | |
"X": "1", | |
"Y": "2" | |
}, | |
{ |
This song is Copyrighted in U.S., under Seal of Copyright # 154085, for a period of 28 years, and anybody caught singin it without our permission, will be mighty good friends of ourn, cause we don’t give a dern. Publish it. Write it. Sing it. Swing to it. Yodel it. We wrote it, that’s all we wanted to do.
# coding=UTF-8 | |
from __future__ import division | |
import nltk | |
from collections import Counter | |
# This is a simple tool for adding automatic hashtags into an article title | |
# Created by Shlomi Babluki | |
# Sep, 2013 | |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
import requests | |
import logging | |
import httplib | |
# Debug logging | |
httplib.HTTPConnection.debuglevel = 1 | |
logging.basicConfig() | |
logging.getLogger().setLevel(logging.DEBUG) | |
req_log = logging.getLogger('requests.packages.urllib3') | |
req_log.setLevel(logging.DEBUG) |
var landGrid = [ | |
{ | |
"X": "1", | |
"Y": "1" | |
}, | |
{ | |
"X": "1", | |
"Y": "2" | |
}, | |
{ |