Skip to content

Instantly share code, notes, and snippets.

View Mutepuka's full-sized avatar

Musonda Makena Mutepuka

View GitHub Profile
@skulltech
skulltech / dl.py
Created February 6, 2018 23:50
Handy Python function for downloading file with progress bar
import sys
import requests
def download(url, filename):
with open(filename, 'wb') as f:
response = requests.get(url, stream=True)
total = response.headers.get('content-length')
if total is None:
@ericelliott
ericelliott / env-examples.md
Last active February 6, 2024 20:57
env-examples

Most configuration really isn't about the app -- it's about where the app runs, what keys it needs to communicate with third party API's, the db password and username, etc... They're just deployment details -- and there are lots of tools to help manage environment variables -- not the least handy being a simple .env file with all your settings. Simply source the appropriate env before you launch the app in the given env (you could make it part of a launch script, for instance).

env files look like this:

SOMEVAR="somevalue"
ANOTHERVAR="anothervalue"

To source it:

$ source dev.env # or staging.env, or production.env, depending on where you're deploying to