Skip to content

Instantly share code, notes, and snippets.

View dsaves's full-sized avatar
🕚
"The nest is full of nothing when the bird has flown."

dsaves dsaves

🕚
"The nest is full of nothing when the bird has flown."
View GitHub Profile

Keybase proof

I hereby claim:

  • I am dsaves on github.
  • I am dsaves (https://keybase.io/dsaves) on keybase.
  • I have a public key ASBe3xUoiIZhiyu_9zii4IWEfM35Q5eKZ2oSY_o0v_WsnQo

To claim this, I am signing this object:

@dsaves
dsaves / gist:8ab62218f4d9d3a087868bc1c0ee4cb0
Created February 23, 2020 01:51
Delete multiple git branches
git branch | grep "<pattern>"
git branch | grep "<pattern>" | xargs git branch -D
@dsaves
dsaves / gist:817757bd532a497e5160cb764e5842c8
Created February 6, 2020 18:50 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@dsaves
dsaves / .vimrc
Last active August 20, 2018 23:37
.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
@dsaves
dsaves / settings.py
Created July 24, 2018 00:48
relevant django settings.py for social auth stuff
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)
@dsaves
dsaves / etc_nginx_sites-available_falcon
Last active July 20, 2018 20:44
nginx config file (working now w/ gunicorn + django)
#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;
}
@dsaves
dsaves / .gitconfig
Created July 11, 2018 22:03
Sample .gitconfig file, setup with mergetool kdiff3
[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"]
@dsaves
dsaves / powershell_api.ps1
Created July 5, 2018 21:19
Powershell script for REST API over HTTPS
################################################
# 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
@dsaves
dsaves / django_prod_checklist.txt
Created June 18, 2018 18:24
Django prod checklist
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__”