This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ $# -ne 1 ]; then | |
echo "$(basename $0) <claim-token>" | |
echo -e "\nGet claim token here: https://www.plex.tv/claim/" | |
exit 1 | |
fi | |
claim_token=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assumes the database container is named 'db' | |
DOCKER_DB_NAME="$(docker-compose ps -q db)" | |
DB_HOSTNAME=db | |
DB_USER=postgres | |
LOCAL_DUMP_PATH="path/to/local.dump" | |
docker-compose up -d db | |
docker exec -i "${DOCKER_DB_NAME}" pg_restore -C --clean --no-acl --no-owner -U "${DB_USER}" -d "${DB_HOSTNAME}" < "${LOCAL_DUMP_PATH}" | |
docker-compose stop db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function git_daily --description 'Daily stats for given git branch' | |
# git log --since=1.day --author='<YOUR_EMAIL>' --shortstat $argv | awk '/^ [0-9]/ { f += $1; i += $4; d += $6 } END { printf("%d files changed, %d insertions(+), %d deletions(-)", f, i, d) }' | |
git log --since=12.hours --author='<YOUR_EMAIL>' --shortstat $argv | awk '/^ [0-9]/ { f += $1; i += $4; d += $6 } END { printf("%d files changed, %d insertions(+), %d deletions(-)", f, i, d) }' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bind r source-file ~/.tmux.conf | |
# remap prefix to Control-a | |
set -g prefix C-a | |
# bind 'C-a C-a' to type 'C-a' | |
bind C-a send-prefix | |
unbind C-b | |
set -g default-terminal "screen-256color" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<string xmlns="http://webservices.theshootingwarehouse.com/smart/Orders.asmx"><NewDataSet> | |
<Table> | |
<ORDNO>2378426</ORDNO> | |
<ORCUST>99994</ORCUST> | |
<ORPO>123</ORPO> | |
<ORCONO>123</ORCONO> | |
<ORDATE>151027</ORDATE> | |
<MSG>This is a test order.</MSG> | |
<ORAIR /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.rails.allowAction = function(link) { | |
if ( ! link.attr('data-confirm') ) return true; | |
$.rails.showConfirmDialog(link); | |
return false; | |
}; | |
$.rails.confirmed = function(link) { | |
link.removeAttr('data-confirm'); | |
link.trigger('click.rails'); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class WmaToMp3 | |
TEMP_WAV = 'audiodump.wav' | |
def self.convert!(path) | |
wma_files = Dir.glob(File.join(path, "**/*.wma"), File::FNM_CASEFOLD) | |
if wma_files.empty? | |
STDOUT.puts "No .wma files found at: #{path}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in (ls *.flac); ffmpeg -i "$f" -acodec libmp3lame -ab 320k (echo mp3/(basename $f .flac).mp3); end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = YOUR NAME | |
email = YOUR EMAIL | |
[github] | |
user = GITHUB USERNAME | |
token = GITHUB TOKEN | |
[core] | |
pager = less -FMRX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "\n== Stashing changes..." | |
git stash && | |
echo "\n== Pulling latest code..." | |
git pull && | |
echo "\n== Removing old build/ dir..." | |
rm -rf ./build/ && |
NewerOlder