start new:
tmux
start new with session name:
tmux new -s myname
source "https://rubygems.org" | |
ruby "2.0.0" | |
gem 'sinatra' | |
group :production, :staging do | |
gem 'oboe-heroku', '~> 0.9.10.0' | |
end |
#!/bin/bash | |
git grep -l replaceMe | xargs sed -i 's/replaceMe/replace.me/g' |
# Useful way to stub an endpoint with JSON contained in a file. | |
import json | |
f = open('/path/to/file.json', 'r') | |
return json.load(f) |
rsync --ignore-existing --dry-run --verbose -r SOURCE/* DESTINATION |
#!/bin/bash | |
# http://johnmacfarlane.net/pandoc/demos.html | |
pandoc -s README.md -o README.html |
# List audio devices | |
ffmpeg -list_devices true -f dshow -i dummy | |
# Pipe audio from Line In to another computer (192.168.1.17) | |
ffmpeg -f dshow -i audio="Line In (High Definition Audio " -acodec libmp3lame -ab 320000 -f rtp rtp://192.168.1.17:1234 | |
# Listen to audio on destination computer | |
ffplay rtp://192.168.1.17:1234 |
from django.contrib.auth.decorators import user_passes_test, login_required | |
active_required = user_passes_test(lambda u: u.is_active, | |
login_url='/profile/not_active') | |
def active_and_login_required(view_func): | |
decorated_view_func = login_required(active_required(view_func)) | |
return decorated_view_func |