npm install -g .
$ sudo -E xfwd
#### I am no Bash expert, I just googled and put this script together | |
#### Be free to fork and post updates to this gist | |
#### Also, you can change the username and email below for the django superuser | |
DEFAULT_USER="admin" | |
DEFAULT_EMAIL="admin@mail.com" | |
DEFAULT_PASS="pass" | |
function usage | |
{ |
from transitions import Machine | |
class Payments(models.Model): | |
STATES = { | |
'started': 'Started', | |
'captured': 'Captured', | |
'completed': 'Completed', | |
} |
class Payments(models.Model): | |
STATES = { | |
'started': 'Started', | |
'captured': 'Captured', | |
'completed': 'Completed', | |
'incomplete': 'Incomplete', # new incomplete state for us | |
} | |
def __init__(self, *args, **kwargs): | |
super(Payments, self).__init__(*args, **kwargs) |
class Payments(models.Model): | |
STATES = { | |
'started': 'Started', | |
'captured': 'Captured', | |
'completed': 'Completed', | |
} | |
state = models.CharField(default='started', choices=STATES.items(), max_length=16) | |
def __init__(self, *args, **kwargs): |
class Payment(models.Model): | |
STATE_CHOICES = ( | |
('started', 'Started'), | |
('captured', 'Captured'), | |
('completed', 'Completed'), | |
# we introduce a new "incomplete" state | |
('incomplete', 'Incomplete'), | |
) | |
def can_complete(self): |
class Payment(models.Model): | |
STATE_CHOICES = ( | |
('started', 'Started'), | |
('captured', 'Captured'), | |
('completed', 'Completed'), | |
) | |
state = models.CharField(choices=STATE_CHOICES, default='started', max_length=16) | |
def can_capture(self): |
class Payment(models.Model): | |
is_started = models.BooleanField(default=True) | |
is_captured = models.BooleanField(default=False) | |
is_completed = models.BooleanField(default=False) | |
def can_capture(self): | |
return self.is_started and not self.is_captured and not self.is_completed | |
def can_complete(self): | |
return self.is_captured |
import sys | |
from urllib import urlencode | |
import requests | |
from urlparse import urlparse, parse_qs | |
from random import choice | |
import re | |
self_id = None # your facebook id here | |
utc_bday = None # utc timestamp of your birthday |
#### I am no Bash expert, I just googled and put this script together | |
#### Be free to fork and post updates to this gist | |
#### Also, you can change the username and email below for the django superuser | |
DEFAULT_USER="dhruv" | |
DEFAULT_EMAIL="dbaldawa@enthought.com" | |
DEFAULT_PASS="d" | |
function usage | |
{ |