Simulate a slow network connection with one command.
Turn on:
$> sudo ./slow-it-down
Your tubes are now filled with molasses
#!/bin/sh | |
# Convenience functions to set the tmux session name based on branches/pull | |
# numbers and switches branches based on the session name. | |
# | |
# Depends on tmux and https://github.com/iFixit/git-scripts. | |
# (feature|hotfix) switch based on the session name. | |
function tswitch { | |
BRANCH=$(tmux display-message -p '#S' | sed 's/|.*$//') |
#!/bin/bash -e | |
# given a commit, find immediate children of that commit. | |
for arg in "$@"; do | |
for commit in $(git rev-parse $arg^0); do | |
for child in $(git log --format='%H %P' --all | grep -F " $commit" | cut -f1 -d' '); do | |
git describe $child | |
done | |
done | |
done |
DELIMITER $$ | |
DROP PROCEDURE IF EXISTS add_email_address_column_to_customers_table $$ | |
-- Create the stored procedure to perform the migration | |
CREATE PROCEDURE add_email_address_column_to_customers_table() | |
BEGIN | |
-- Add the email_address column to the customers table, if it doesn't already exist |
// Yields the approximate result of a division by 1000. | |
// NOTE: Can only be used for numbers less than 140,737,488,290 | |
unsigned long quickDiv1000(unsigned long num) | |
{ | |
unsigned long result; | |
result = num * 65 + (num >> 2) + (num >> 5) + (num >> 8)+ (num >> 11) + 32768; | |
return (result >> 16); | |
} |
As configured in my dotfiles.
start new:
tmux
start new with session name:
CC = clang | |
CFLAGS = -Wall -g | |
LDFLAGS = -framework CoreFoundation | |
TARG = syncdefaults | |
SRC=\v | |
syncdefaults.c\ |
#!/bin/bash | |
LINES=$(tput lines) | |
COLUMNS=$(tput cols) | |
declare -A snowflakes | |
declare -A lastflakes | |
clear |