Skip to content

Instantly share code, notes, and snippets.

create user <user> with password '<password>';
create database <database>;
grant all privileges on database <database> to <user>;
alter user <user> createdb;
drop schema public cascade;
create schema public;
alter schema public owner to <user>;
function getUrlParam( paramName ) {
var reParam = new RegExp( '(?:[\?&]|&)' + paramName + '=([^&]+)', 'i' ) ;
var match = window.location.search.match(reParam) ;
return ( match && match.length > 1 ) ? match[ 1 ] : null ;
}
from django.contrib.auth.models import User
User.objects.create_user('<username>', '<email>', '<password>')
if not (reportlab.Version[0] == "2" and reportlab.Version[2] >= "1"):
raise ImportError("Reportlab Version 2.1+ is needed!")
REPORTLAB22 = (reportlab.Version[0] == "2" and reportlab.Version[2] >= "2")
if not (reportlab.Version[:3]>="2.1"):
raise ImportError("Reportlab Version 2.1+ is needed!")
REPORTLAB22 = (reportlab.Version[:3]>="2.1")
pip install django-extensions
Then add django_extensions to your INSTALLED_APPS in settings.py. then from the console just type the following
python manage.py show_urls
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
ssh -f -N -L <local port>:<remote addr>:<remote port> <remote ssh user>@<remote ssh addr>
vim ~/.bash_profile
# Set architecture flags
export ARCHFLAGS="-arch x86_64"
# Ensure user-installed binaries take precedence
export PATH=/usr/local/bin:$PATH
# Load .bashrc if it exists
test -f ~/.bashrc && source ~/.bashrc
https://python-docx.readthedocs.org/en/latest/#what-it-can-do
https://openpyxl.readthedocs.org/en/latest/