This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "vars": { | |
| "@gray-darker": "lighten(#000, 13.5%)", | |
| "@gray-dark": "lighten(#000, 20%)", | |
| "@gray": "lighten(#000, 33.5%)", | |
| "@gray-light": "lighten(#000, 46.7%)", | |
| "@gray-lighter": "lighten(#000, 93.5%)", | |
| "@brand-primary": "#428bca", | |
| "@brand-success": "#5cb85c", | |
| "@brand-info": "#5bc0de", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Orignal version taken from http://www.djangosnippets.org/snippets/186/ | |
| # Original author: udfalkso | |
| # Modified by: Shwagroo Team and Gun.io | |
| import sys | |
| import os | |
| import re | |
| import hotshot, hotshot.stats | |
| import tempfile | |
| import StringIO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def cpf_valid(cpf, d1=0, d2=0, i=0): | |
| try: | |
| while i < 10: | |
| d1, d2, i = (d1 + (int(cpf[i]) * (11-i-1))) % 11 if i < 9 else d1, (d2 + (int(cpf[i]) * (11-i))) % 11, i + 1 | |
| return (int(cpf[9]) == (11 - d1 if d1 > 1 else 0)) and (int(cpf[10]) == (11 - d2 if d2 > 1 else 0)) | |
| except: | |
| return False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ALTER TABLE {tablename} ALTER COLUMN id SET DEFAULT nextval('{tablename}_id_seq'::regclass); | |
| -- replace {tablename} with the curly braces with the table name | |
| -- the sequence name is generally in the form of {tablename}_id_seq but it can be anything, check in pgadmin its name | |
| -- some softwares accidentaly delete this while doing some table operations |