Instantly share code, notes, and snippets.

View .vimrc
" Convert tabs to 4 spaces,
" Trim trailing whitespace
function! Wspace()
:%s/\t/ /g
:%s/\s\+$//e
endfunction
command! Wspace call Wspace()
set hlsearch
"filetype plugin indent on
View settings.py
from social_core.pipeline import DEFAULT_AUTH_PIPELINE
SECRET_KEY = <secret key here> # make sure secret key is not something autogenerated, otherwise your sessions will get invalidated! Boo!
SOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_DOMAINS = ['<your_domain_here>.com'] # so not everyone with a google account can log in to intranet site
SOCIAL_AUTH_GOOGLE_OAUTH2_AUTH_EXTRA_ARGUMENTS = {'prompt': 'select_account'}
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = <your key here>
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = <your secret here>
SOCIAL_AUTH_PIPELINE = list(DEFAULT_AUTH_PIPELINE)
View .gitconfig
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
# below is for SSH
url = git@github.com:<YOUR_GITHUB_USERNAME>/<YOUR_REPO_NAME>.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
View powershell_api.ps1
################################################
# Fix registry entries for SSL related dlls,
# otherwise SSL might not work on your
# Windows machine
################################################
regsvr32 Softpub.dll /s
regsvr32 Initpki.dll /s
regsvr32 Wintrust.dll /s
regsvr32 Mssip32.dll /s
View django_prod_checklist.txt
settings.py
Turn off debug
Edit ALLOWED_HOSTS
Remove plain-text SECRET_KEY
Dangerous libs/functions:
eval(), exec(), execfile()
cPickle.loads()
pyyaml.load()
ModelForms.Meta.exclude()
ModelForms.Meta.fields = ”__all__”
View etc_nginx_sites-available_falcon
#upstream prod_server {
# server unix:/home/ubuntu/falcon/django_sandbox/falcon_project/tutorial.sock fail_timeout=0;
#}
# Redirect http traffic to use https instead
server {
server_name your_server_name.com;
listen 80;
return 301 https://your_server_name.com$request_uri;
}