Skip to content

Instantly share code, notes, and snippets.

@alokmishra
alokmishra / check_singapore_nric_validity.py
Last active December 15, 2021 06:20
Check validity of Singapore NRIC number
""" This module has utility methods related to Singapore NRIC number"""
def check_nric_sg(nric):
""" check if a nric is valid or not"""
list_m = [2, 7, 6, 5, 4, 3, 2]
list_st = list('JZIHGFEDCBA')
list_fg = list('XWUTRQPNMLK')
if len(nric) != 9:
return False
graph LR
A(Appointment) --> B(Charge card)
B --> C{Success}
C -->|Yes| D[Gen invoice no]
C -->|No| E[Log failed payment]
D--> F(Create record in table, status=paid)
M(Chat) --> N(Chat complete)
N--> O(Charge Card)
O --> P{Success}
@alokmishra
alokmishra / gist:835276
Created February 19, 2011 19:03 — forked from anonymous/gist:156623
deploy with gunicorn django fabric git
"""
This fabric file makes setting up and deploying a django application much
easier, but it does make a few assumptions. Namely that you're using Git,
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have
Django installed on your local machine and SSH installed on both the local
machine and any servers you want to deploy to.
_note that I've used the name project_name throughout this example. Replace
this with whatever your project is called._