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
let counter = 0;
function myFunction() {
//Find emails from sender no-reply@harborfreight.com or noreply@harborfreight.com that contain receipts attached
let senders = ["noreply@harborfreight.com", "no-reply@harborfreight.com"]
// Save them to a folder in Drive
senders.forEach(
(sender) => { searchMail(sender); }
)
}
#!usr/bin/python3
#multidownload_xkcd.py - Multi Threaded image download
import requests, os, bs4, threading
import logging
#store comics in ./xkcd
os.makedirs('xkcd', exist_ok=True)
os.chdir("xkcd")
@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`