Skip to content

Instantly share code, notes, and snippets.

View mdespriee's full-sized avatar

mathieu mdespriee

View GitHub Profile
@mdespriee
mdespriee / random_crypto_string.sh
Last active August 29, 2016 14:06
Create random cryptographic string
cat /dev/urandom | tr -dc '[:alnum:]' | fold -w 64 | head -n 1
@mdespriee
mdespriee / string_normalization.py
Created December 23, 2015 13:15
Unicode string normalization
def normalize(s):
""" Expects a unicode string, not encoded byte string.
Returns unicode string
"""
out = ''.join( c for c in unicodedata.normalize("NFKD", s)
if not unicodedata.combining(c) )
out = _regexAlpha.sub(' ', out)
out = _regexSpace.sub(' ', out)
out = out.strip().upper()
return out
export SBT_OPTS="-Xmx4G -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=2G -Xss2M "
select tablename,
HAS_TABLE_PRIVILEGE(tablename, 'select') as select,
HAS_TABLE_PRIVILEGE(tablename, 'insert') as insert,
HAS_TABLE_PRIVILEGE(tablename, 'update') as update,
HAS_TABLE_PRIVILEGE(tablename, 'delete') as delete,
HAS_TABLE_PRIVILEGE(tablename, 'references') as references
from pg_tables where schemaname='public' order by tablename;