Skip to content

Instantly share code, notes, and snippets.

View jaredlockhart's full-sized avatar

Jared Lockhart jaredlockhart

View GitHub Profile
[((310.0, 22425.0), 1),
((460.0, 25.0), 1),
((311.0, 4181.0), 1),
((262.0, 457.0), 1),
((102.0, 125.0), 1),
((111.0, 110.0), 1),
((216.0, 25.0), 1),
((311.0, 1541.0), 1),
((230.0, 10.0), 1),
((302.0, 1548.0), 1),
[((310.0, 22425.0), 1, 145.0),
((460.0, 25.0), 1, 3.0),
((311.0, 4181.0), 1, 25.0),
((262.0, 457.0), 1, 9.0),
((102.0, 125.0), 1, 20.0),
((111.0, 110.0), 1, 1.0),
((216.0, 25.0), 1, 48.0),
((311.0, 1541.0), 1, 39.0),
((230.0, 10.0), 1, 1.0),
((302.0, 1548.0), 1, 44.0),
[((310.0, 22425.0), 1, 2762.0),
((460.0, 25.0), 1, 29871.0),
((311.0, 4181.0), 1, 285.0),
((262.0, 457.0), 1, 86.0),
((102.0, 125.0), 1, 1140.0),
((111.0, 110.0), 1, 0.0),
((216.0, 25.0), 1, 624.0),
((311.0, 1541.0), 1, 540.0),
((230.0, 10.0), 1, 0.0),
((302.0, 1548.0), 1, 688.0),
from uuid import uuid4
_cache = {}
def cache_set(key, value):
print 'Setting ', key, ' with value ', value
_cache[key] = value
def cache_get(key):
print 'Returning ', key, ' from cache'
docker run --net=host -t leaderboard echo "select count(*) from locations_country" | ./manage.py dbshell
docker run --net=host -t leaderboard ./manage.py generate_contributors 1 1
docker run --net=host -t leaderboard ./manage.py compute_ranks
docker run --net=host -t leaderboard ./manage.py migrate
docker run --net=host -t leaderboard sh -c 'echo "from leaderboard.locations.models import Country;Country.objects.all().delete()" | python manage.py shell; python manage.py migrate; sh ./scripts/setup_countries.sh'
docker run --net=host -t leaderboard sh -c 'echo "from leaderboard.locations.models import Country;Country.objects.all().delete()" | python manage.py shell; python manage.py migrate --noinput; sh ./scripts/setup_countries.sh'