Skip to content

Instantly share code, notes, and snippets.


Jacob Rief jrief

  • Innsbruck, Tirol, Austria
View GitHub Profile

Workflows (States) in Django

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.

Common Software Uses

  • Publishing (Draft->Approved->Published->Expired->Deleted)
pfote /
Created Dec 5, 2013
postgres LISTEN/NOTIFY psycopg2/twisted
import psycopg2
import psycopg2.extensions
from select import select
from twisted.internet import threads
class AsyncNotify():
based on, adapted to newer psycopg version
Class to trigger a function via PostgreSQL NOTIFY messages.
Mithrandir0x / gist:3639232
Created Sep 5, 2012
Difference between Service, Factory and Provider in AngularJS
View gist:3639232
// Source:!topic/angular/hVrkvaHGOfc
// jsFiddle:
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"