First, load some data via the admin that should always be there when someone installs the app.
Next, dump that data out into JSON format into a fixture:
$ ./manage.py dumpdata [app_name] > [app_name]/fixtures/initial_data.json| This playbook has been removed as it is now very outdated. |
| #! /usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # T: an array containing the values of the coins | |
| # L: integer wich is the total to give back | |
| # Output: Minimal number of coins needed to make a total of L | |
| def dynamicCoinChange( T, L ): | |
| Opt = [0 for i in range(0, L+1)] | |
| // app.js | |
| const KEY = 'express.sid' | |
| , SECRET = 'express'; | |
| var express = require('express') | |
| , app = express() | |
| , server = require('http').createServer(app) | |
| , io = require('socket.io').listen(server) | |
| , cookie = express.cookieParser(SECRET) | |
| , store = new express.session.MemoryStore() |
| # Installation | |
| brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid | |
| # Easy Peasy | |
| ffmpeg -i video.mp4 video.webm |
| """ | |
| An asynchronous task manager. | |
| This is a simple implementation for background task handing. No guarentees are | |
| provided for task execution. | |
| This was developed in the course of the work don for the victims project and | |
| that version is available at | |
| https://github.com/victims/victims-web/blob/master/src/victims_web/handlers/task.py |
| # delete local tag '12345' | |
| git tag -d 12345 | |
| # delete remote tag '12345' (eg, GitHub version too) | |
| git push origin :refs/tags/12345 | |
| # alternative approach | |
| git push --delete origin tagName | |
| git tag -d tagName |
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.
| docker rmi $(docker images -q -f dangling=true) |