Skip to content

Instantly share code, notes, and snippets.

View aquaerius's full-sized avatar

Gustavo Varela aquaerius

  • Mac 195 Engineering Corporation
  • Miami - Fort Lauderdale Area
View GitHub Profile
@aquaerius
aquaerius / .bashrc
Created May 24, 2018 16:17 — forked from justintv/.bashrc
Display git branch in bash prompt
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer!
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ "
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty!
# ~/code/web:beta_directory$ git checkout master
# Switched to branch "master"
# ~/code/web:master$ git checkout beta_directory
# Switched to branch "beta_directory"
@aquaerius
aquaerius / secret-key-gen.py
Created April 20, 2018 10:17 — forked from ndarville/secret-key-gen.py
Generating a properly secure SECRET_KEY in Django
"""
Two things are wrong with Django's default `SECRET_KEY` system:
1. It is not random but pseudo-random
2. It saves and displays the SECRET_KEY in `settings.py`
This snippet
1. uses `SystemRandom()` instead to generate a random key
2. saves a local `secret.txt`