Skip to content

Instantly share code, notes, and snippets.

@sesh
sesh / gist:9523021
Last active August 29, 2015 13:57
Python timezone aware datetime oddity
In [1]: import pytz
In [2]: from datetime import datetime
In [3]: melb = pytz.timezone('Australia/Melbourne')
In [4]: datetime.now().replace(tzinfo=melb)
Out[4]: datetime.datetime(2014, 3, 13, 17, 50, 33, 889107, tzinfo=<DstTzInfo 'Australia/Melbourne' EST+10:00:00 STD>)
In [5]: melb.localize(datetime.now())
Your username on github: sesh
You need a passphrase to unlock the secret key for
user: "keybase.io/sesh <sesh@keybase.io>"
4096-bit RSA key, ID E9643BB8EC415A33, created 2014-03-17
(subkey on main key ID 90657B6089B9D33C)
Please publicly post the following Gist, and name it keybase.md:
### Keybase proof
-----BEGIN PGP MESSAGE-----
Version: Keybase OpenPGP JS 0.0.1
Comment: https://keybase.io/crypto
wcFMA+b/sNaawLdMARAAgCZHeKU0QHIRKMRhoYuhygsAif22UdAH5L6L02OHIWXI
WRlJ/3pRS/AdVXc++bRZIXmRF2lDxsPk8f6iOlMFI5trBLdyGuKHrtIcY1Z85R8A
dlsx47tx3Hw7JAGWCTbL2riEn/tUhgViTup9ewBRY0dazWSkYYwd1C6sFlNrmqJK
9/gz+Czd/44SDmcceP/FboHGiWWAM71qVQeaQ0rqExqKeVqFnNwPMM9oW9Vkj0YA
Rorg54cQPNuZevel8xFvDwiNVQuxmnKRI1HHJICN09dTIvOqvbG/ZthQ0McojjY5
tQkj8Ui4XKFrxycz8gQMy5k5h8EXP98PRO9of4lNYga4t/A8zLkKH2BPdxa6JRw3
# Obviously for an actual release, replace <release tag> with actual release tag, eg. r41
# On deploying machine, get fabfile up to date
git fetch origin
git checkout master
git merge origin/master
# ASIA
tsocks fab set_agents:celeryasia,asia deploy_celery mark_deployed:<release tag>
tsocks fab set_agents:appasia,asia deploy_apps mark_deployed:<release tag>
@sesh
sesh / gist:cf5fd770c0f913aeaeac
Created July 10, 2014 07:51
Lightning Talks
Five Sticks Of Celery
Dan
Setting up Django with config files
Jon
A free course on Databases
Anthony
How I learned to stop RESTing and love RPC
@sesh
sesh / gist:980d20dc8e1f8ff4da1b
Created November 25, 2014 00:50
Download Flowdock Avatars
$('.user-avatar').each(function(e) { if ($(this).parent().find('.user-name').attr('title')) { console.log("aria2c " + $(this).css('background-image').replace('url(', '').replace(')', '').replace('/72', '/600') + " > '" + $(this).parent().find('.user-name').attr('title') + ".png'") } })
[{"id":1,"cardType":"A","text":"Flying sex snakes.","numAnswers":0,"expansion": "Base"},
{"id":2,"cardType":"A","text":"Michelle Obama's arms.","numAnswers":0,"expansion": "Base"},
{"id":3,"cardType":"A","text":"German dungeon porn.","numAnswers":0,"expansion": "Base"},
{"id":4,"cardType":"A","text":"White people.","numAnswers":0,"expansion": "Base"},
{"id":5,"cardType":"A","text":"Getting so angry that you pop a boner.","numAnswers":0,"expansion": "Base"},
{"id":6,"cardType":"A","text":"Tasteful sideboob.","numAnswers":0,"expansion": "Base"},
{"id":7,"cardType":"A","text":"Praying the gay away.","numAnswers":0,"expansion": "Base"},
{"id":8,"cardType":"A","text":"Two midgets shitting into a bucket.","numAnswers":0,"expansion": "Base"},
{"id":9,"cardType":"A","text":"MechaHitler.","numAnswers":0,"expansion": "Base"},
{"id":10,"cardType":"A","text":"Being a motherfucking sorcerer.","numAnswers":0,"expansion": "Base"},

class: middle center

MelbDjango 1.8

MelbDjango Logo

29.2,29.2,29.2,29.8,29.6,29,28.8,29.2,29.2,28.6,28.4,28.6,28.6,28.2,28.6,28.6,28.6,28.6,28.6,28.6,28.4,28.6,28.8,28.6,28.6,28.6,28.6,28.6,28.6,28.4,28.4,28.4,28.4,28.6,29,29,28.6,28.6,28.4,27.8,27.2,27.4,26.6,25.6,25.4,25.6,26,26,25.4,25,24.4,24,25.4,25.2,25.6,24.8,26.8,25.4,25.2,26.2,26.4,26.6,26,27,27.8,27.4,26.6,26.4,26.6,26.4,26.8,25.6,25.2,25.4,26.8,26.6,27,26.6,28,27.8,29,28.8,28.8,28.4,28.6,29,29,28.8,28.8,29.2,30.2,31.4,31.6,31.6,32.6,33.4,33.6,33.8,35.2,36.4,36.8,37.4,38.4,38.6,39.6,39.6,40.2,40,40.6,41,42,42.4,42.4,42.6,42.8,42.8,42.8,43,43.2,43.2,43,43,43,43,43.2,43.2,43.6,43.6,43.2,43.2,42.8,42.8,42.8,42.8,43,43,43.2,43,42.8,42.4,42.2,42.6,42.2,42.2,42.2,42.4,42.4,42.8,43.6,43.2,43.2,43,43.4,43.4,44,43.4,44,44.4,44.4,44.6,43.6,43.4,42.8,41.8,40.8,40.4,40,40,40.6,40.8,38,37.8,37.8,37.6,37,35.6,36.6,37.2,36.4,36.8,37,35.6,37.2,37.8,37.4,37.8,38,38.4,37.8,38,39.2,39.6,39.2,39.4,39,39,37.6,38.2,38.4,38.6,38.6,38.6,38.8,39,39.2,39.2,38.6,37.4,37.6,37.8,38.2,39.2,39.4,39.2,38.6,38.8,38.6,38.6,38,36.6,37
@sesh
sesh / gist:7545ffb9c10d044d0280
Created March 18, 2015 22:48
SSH Public Key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD24GTa/tAREuvgosIo+vKwwsizfvrTdUrSoIEFUff18mWZWm7x9VJgrn7+8Ue+r8MKep6tDR03h6RPrFmuqQVGr799HTVo8D7cLTqna/GkWCG4xE/tTaeMwWYQLRzfzE4N/XwD4e608sceje0w/xWnH9cnQDJ/jD09Eh6CsQpR97RY9I+6iV7x/puxQ/K6XjkqPztY/FBJMr6OipDs9XVErbUSi0YNvC/L04+TEh+jj7RCqLpw4vvwim4H9TvGlnPX7Oi1MVKsO++LfIg+TOp9d5zwnEDJqMm69DLqhZ+lqJOEv9NfNv6kMb443mpcPrQSkodv0fj7Xtir57Kyt1xL brenton@brntn.me