Skip to content

Instantly share code, notes, and snippets.

@jaywhy13
jaywhy13 / gist:5783986
Created June 14, 2013 18:06
Change Python Path
The Python PATH can be changed by either editing HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python (if we're on 64-bit) or HKEY_LOCAL_MACHINE\SOFTWARE\Python if we're using a 32-bit machine. This may be necessary in cases of like custom installations.
@jaywhy13
jaywhy13 / gist:5716329
Created June 5, 2013 19:07
Find database size in PostgreSQL
SELECT nspname || '.' || relname AS "relation",
pg_size_pretty(pg_relation_size(C.oid)) AS "size"
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE nspname NOT IN ('pg_catalog', 'information_schema')
ORDER BY pg_relation_size(C.oid) DESC
LIMIT 20;
Number.prototype.plural = function(){
if(this > 1 || this == 0){
return true;
} else {
return false;
}
}
String.prototype.pluralize_rules = function(){
return [[new RegExp('$', 'gi'), 's']];
su postgres
pg_dropcluster --stop 9.1 main
pg_upgradecluster 8.4 main