Skip to content

Instantly share code, notes, and snippets.

View chaimleib's full-sized avatar

Chaim Halbert chaimleib

View GitHub Profile
@chaimleib
chaimleib / nameDownloaded.sh
Created October 22, 2014 04:55
Gets the actual name of a remote file, then downloads to an identically-named file
#!/bin/bash
function getUriFilename() {
header="$(curl -sI "$1" | tr -d '\r')"
filename="$(echo "$header" | grep -o -E 'filename=.*$')"
if [[ -n "$filename" ]]; then
echo "${filename#filename=}"
return
fi
@chaimleib
chaimleib / virtualenv.sh
Created June 26, 2014 20:31
Setup for virtualenv
function setup() {
pip install virtualenv
pushdir $1 # replace $1 with where the environment dir should be
virtualenv tincan
source tincan/bin/activate
popd
}
function remove() {
deactivate