Skip to content

Instantly share code, notes, and snippets.

@sesh
sesh / gist:5234981
Created March 25, 2013 04:45
Minimal CSS for The Age... Pretty much just remove everything except the article. Breaks the homepage, but that's kind of intentional.
/* All pages */
#network-strip {
display:none;
}
.outerWrap {
padding-top: 0px;
}
.header h2, .header h2 a {

MySQL: dumped

Maybe you've read some of the [PHP hate] (http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/) that's out there. I used to write PHP and you know, it works, you can get things done. The same goes for MySQL. I kind of feel like in this day and age MySQL is the relational database analogue of the [lingering legacy of the PHP singularity] (http://www.codinghorror.com/blog/2012/06/the-php-singularity.html).

Basically, MySQL works and you can definitely use it to build and run successful applications. Facebook uses it. But the important point to consider is that Postgres ..... is better. It's more or less a fact. How and why? Well there are numerous articles out there for you to google up but [here's a screencast] (http://www.youtube.com/watch?v=1PoFIohBSM4) that gives you a reasonable breakdown, by example.

So just like I left PHP behind, now I've left MySQL behind. You could say I've mysqldumped it forever. Now, [WHO'S COMIN WITH ME?!] (http://www.youtube.com/wat

@sesh
sesh / gist:7132492
Last active December 26, 2015 09:49
MelbDjango website, basic requirements

Phase 1

Hosted on Heroku (we can use my account for now).

Ability to make Posts

  • Posts should have a published date

Ability to make Events (could be a subclass of Post?)

  • has a date, time, duration and location
  • can have many speakers
sudo apt-get install unzip;
wget -O /tmp/chromedriver.zip http://chromedriver.googlecode.com/files/chromedriver_linux64_19.0.1068.0.zip && sudo unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/;
@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'") } })