Skip to content

Instantly share code, notes, and snippets.

View bnjmn's full-sized avatar

Benjamin Petersen bnjmn

  • Arizona
  • 20:47 (UTC -07:00)
View GitHub Profile
@dstufft
dstufft / fabfile.py
Created March 10, 2011 02:01
A fabfile for deploying a Django app with VirtualEnvWrapper, PIP and Supervisor
# Run this like fab -R www deploy
from fabric.api import *
REPO_URL = '[email protected]:username/repo.git'
PROJECT_DIR = '$HOME/projects/projectname'
PROJECT_NAME = 'projectname'
SERVER_NAME = 'projectname.servername' # I use gunicorn, so i have projectname.gunicorn
env.roledefs['www'] = ['www1.example.com']
function fish_mode_prompt --description 'Displays the current mode'
# Do nothing if not in vi mode
if test "$fish_key_bindings" = "fish_vi_key_bindings"
switch $fish_bind_mode
case default
set_color --bold red
echo 🅽
case insert
set_color --bold green
echo 🅸
@mihow
mihow / load_dotenv.sh
Last active October 22, 2024 08:26
Load environment variables from dotenv / .env file in Bash
# The initial version
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
# My favorite from the comments. Thanks @richarddewit & others!
set -a && source .env && set +a
@bryant988
bryant988 / zillow.js
Last active November 14, 2024 02:46
Zillow Image Downloader
/**
* NOTE: this specifically works if the house is for sale since it renders differently.
* This will download the highest resolution available per image.
*/
/**
* STEP 1: Make sure to *SCROLL* through all images so they appear on DOM.
* No need to click any images.