Skip to content

Instantly share code, notes, and snippets.

View yurrriq's full-sized avatar
🙈
I may be slow to respond.

Eric Bailey yurrriq

🙈
I may be slow to respond.
View GitHub Profile
@yurrriq
yurrriq / MySQL - reset counter
Created December 28, 2013 21:08
I'm tired of forgetting how to reset the counter in MySQL, so I figured I'd make this my first gist. Big up to Google and http://stackoverflow.com/a/8923132
ALTER TABLE tablename AUTO_INCREMENT = 1
@yurrriq
yurrriq / mp4_from_image_and_audio.sh
Created March 25, 2014 22:38
Creates a QuickTime-friendly MP4 ($3) from an image ($1) and an audio file ($2).
#!/bin/bash
if [ "$#" -eq 3 ]; then
IMAGE="$1"
AUDIO="$2"
OUTPUT="$3"
ffmpeg -loglevel panic \
-f image2 -loop 1 \
-i "$IMAGE" \
-i "$AUDIO" \
@yurrriq
yurrriq / EWAppDelegate.h
Created May 25, 2014 07:14
iOS Deep Linking
#import <UIKit/UIKit.h>
@interface EWAppDelegate : UIResponder<UIApplicationDelegate>
@property(strong, nonatomic) UIWindow *window;
@end
@yurrriq
yurrriq / pprint_json.sh
Created May 29, 2014 14:09
Maybe if I write this out here, I'll never again forget how to pretty print JSON on the command line using Python.
#!/bin/bash
echo '{"print":"pretty"}' | python -m json.tool
@yurrriq
yurrriq / docker-wipe.sh
Created June 11, 2014 22:43
Docker -- Clean Slate
#!/bin/bash
docker stop `docker ps -aq`
docker rm `docker ps -aq`
docker rmi `docker images -aq`
@yurrriq
yurrriq / App-Prefix.pch
Last active August 29, 2015 14:02
Flurry iOS Integration
#import "Flurry.h"
@yurrriq
yurrriq / ruler.js
Created June 20, 2014 20:15
Lazily/cleverly print a horizontal rule
var n = 10
var s = '========'
console.log(Array(n+1).join(s))
@yurrriq
yurrriq / progress.sh
Last active August 29, 2015 14:02
Bash progress indication using tput
#!/bin/bash
echo -n "Progress: "
for x in $(seq -f "%g" 0 99); do
sleep .05
tput cub $((${#x}+1)); echo -n "$((x+1))%"
done
echo
@yurrriq
yurrriq / flush_dns-mavericks.sh
Created June 24, 2014 20:43
Flush DNS Cache on Mac OS X 10.9.x
#!/bin/bash
dscacheutil -flushcache && sudo killall -HUP mDNSResponder
@yurrriq
yurrriq / graphical_haxxx.sh
Last active August 29, 2015 14:03
Hacky one-liner to extract worker stack completion times from mover logs
#!/bin/bash
cat logs/mover.log | awk '/in [0-9]+\.[0-9]+s/{time = $11; sub(/s/, "", time); print $4"-"$3"-"$2"@"$5" " time}' | gnuplot -p -e "set xdata time; set timefmt \"%Y-%b-%d@%H:%M:%S\"; set yrange [0 : 10]; set xrange [\"2014-Jul-07@00:00:00\" : \"2014-Jul-09@00:00:00\"]; set term png size 1920,1080; set xtics format \"%m-%d %H:%M\"; plot '-' using 1:2" | base64