Skip to content

Instantly share code, notes, and snippets.

@rendykstan
rendykstan / py_data_model.py
Last active December 19, 2015 23:18
Python script to better understand Python Data Model
#!/usr/bin/python
"""
It is used to signify the absence of a value in many situations, e.g., it is returned from functions that don’t explicitly
return anything.
"""
print 'None - Its truth value is False.'
bottle = None
if not bottle:
print 'This proves that the truth value of None is False'
"""
@rendykstan
rendykstan / vacuum_analyze.py
Last active December 15, 2015 20:19
VACUUM ANALYZE Postresql tables not covered by the daemon on the daily basis. More info: http://rendykstan.github.com/blog/2013/04/04/postgresql-vacuum-and-analyze-maintenance-and-performance/
#!/usr/bin/python
import psycopg2
import sys
con = None
query = ''
try:
if len(sys.argv) == 6: