(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| ffmpeg \ | |
| -re -y \ | |
| -loop 1 \ | |
| -f image2 \ | |
| -i img_0.jpg \ | |
| -i audio.mp3 \ | |
| -acodec libfdk_aac \ | |
| -ac 1 \ | |
| -ar 44100 \ | |
| -b:a 128k \ |
| # Be sure to save your config files. Optional but I do: | |
| sudo cp /etc/postgresql/9.3/main/postgresql.conf ~ | |
| sudo cp /etc/postgresql/9.3/main/pg_hba.conf ~ | |
| # Package repo (for apt-get) | |
| wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
| sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list.d/postgresql.list' | |
| # Also probably optional but I like to update sources and upgrade | |
| sudo apt-get update |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| DEBUG=True | |
| SOUTH_TESTS_MIGRATE = True | |
| DATABASES = { | |
| 'default': { | |
| 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. | |
| 'NAME': 'geo', # Or path to database file if using sqlite3. | |
| 'USER': 'postgres', # Not used with sqlite3. | |
| 'PASSWORD': 'postgres', # Not used with sqlite3. | |
| 'HOST': '127.0.0.1', # Set to empty string for localhost. Not used with sqlite3. |
I'm going to cover a simple, but effective, utility for managing state and transitions (aka workflow). We often need to store the state (status) of a model and it should only be in one state at a time.
| import signal | |
| class InterruptableRegion(object): | |
| def __init__(self, sig=signal.SIGINT): | |
| self.sig = sig | |
| self.interrupted = False | |
| self.released = False | |
| self.original_handler = None | |
| def __enter__(self): |
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
These are the steps I went through to set up an SSL cert.
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
| Copyright (c) 2015, Shahar Evron | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without modification, | |
| are permitted provided that the following conditions are met: | |
| 1. Redistributions of source code must retain the above copyright notice, this | |
| list of conditions and the following disclaimer. | |
| 2. Redistributions in binary form must reproduce the above copyright notice, |
UPDATE working on this here!
so… I've had this weird idea recently...
In git (and in other secure + distributed systems) you have a tree of hashes where each object is identified by it's hash and objects contain pointers to other objects. They just have the hash of other objects stored inside them.