Steps with explanations to set up a server using:
- Virtualenv
- Virtualenvwrapper
- Django
- Gunicorn
#!/bin/bash | |
# https://gist.github.com/robwierzbowski/5430952/ | |
# Create and push to a new github repo from the command line. | |
# Grabs sensible defaults from the containing folder and `.gitconfig`. | |
# Refinements welcome. | |
# Gather constant vars | |
CURRENTDIR=${PWD##*/} | |
GITHUBUSER=$(git config github.user) |
GitHub's compare view is available at:
https://github.com/$USER/$REPO/compare/$REV_A...$REV_B
Naturally, $USER
and $REPO
are the owner (user/organization) and repository names, respectively.
$REV{A,B}
are the two sides of the compare view; they can either be a ref in $USER
's repository, i.e. the name of a branch, tag or a commit SHA, or it can be a ref in $OWNER
's fork of the repository by using the format $OWNER:$REF
.
You can get a diff or patch for the result of the compare view by appending .diff
or .patch
to the URL, respectively.
#!/usr/bin/env bash | |
ENV_PATH="$(dirname "$(dirname "$(which pip)")")" | |
SYSTEM_VIRTUALENV="$(which -a virtualenv|tail -1)" | |
BAD_ENV_PATHS="/usr/local" | |
echo "Ensure the root of the broken virtualenv:" | |
echo " $ENV_PATH" |
How to have some fun using the terminal.
sudo apt-get install cowsay
sudo apt-get install fortune
sudo apt-get install figlet
ruby -v
gem install lolcat
import { join } from 'path' | |
import { readdir, stat } from 'fs-promise' | |
async function rreaddir (dir, allFiles = []) { | |
const files = (await readdir(dir)).map(f => join(dir, f)) | |
allFiles.push(...files) | |
await Promise.all(files.map(async f => ( | |
(await stat(f)).isDirectory() && rreaddir(f, allFiles) | |
))) | |
return allFiles |
#!/bin/sh | |
#http://www.thegeekstuff.com/2011/01/advanced-regular-expressions-in-grep-command-with-10-examples-%E2%80%93-part-ii/ | |
# GENERAL | |
# print lines begining with range of letters | |
grep ^[A-D] table.txt | |
# REGEX |