Skip to content

Instantly share code, notes, and snippets.

View sadlerjw's full-sized avatar

Jason Sadler sadlerjw

View GitHub Profile
@sadlerjw
sadlerjw / hearthstoneDeckLink.py
Created June 12, 2018 18:58
Python script to generate a link to an HSReplay.net deck, based on a string of text (for example, a tweet) containing a Hearthstone deck code.

tmux cheatsheet

Sessions

:new<CR>  new session
s  list sessions
$  name session

Windows (tabs)

Keybase proof

I hereby claim:

  • I am sadlerjw on github.
  • I am sadlerjw (https://keybase.io/sadlerjw) on keybase.
  • I have a public key whose fingerprint is 83EB 7698 1A59 2325 DBEA 53B6 0133 9C81 C34F 43DC

To claim this, I am signing this object:

@sadlerjw
sadlerjw / objc-accessor-textexpander
Created September 30, 2013 15:57
A TextExpander shortcut that generates Objective-C collection accessor methods. I'm amazed that the compiler can't synthesize these for you, since they're ever-so-formulaic, so I made a shortcut to fill them in automatically. This shortcut takes the following variables: Property name, Upper-cased property name (eg, comments and Comments), variab…
#pragma mark - %filltext:name=Upper-cased Property Name% collection accessor methods
// since Cocoa can't synthesize them for us, even though they're trivial boilerplate
// This makes me very bitter.
- (NSArray *)%filltext:name=Property Name% {
return %filltext:name=Variable%;
}
- (void)set%filltext:name=Upper-cased Property Name%:(NSArray *)%filltext:name=Property Name% {
%filltext:name=Variable% = [%filltext:name=Property Name% mutableCopy];
@sadlerjw
sadlerjw / git-rm-merged.sh
Last active December 21, 2015 01:59
Delete all branches that are already merged into master, both locally, and optionally in a specified remote. Execute "git rm-merged -h" for details.
#!/bin/bash
if [ "$1" == "-h" ]; then
echo "Usage: git rm-merged [remote]"
echo "Removes any local branches already merged into master"
echo "If a remote is supplied, it also removes any branches on that remote that have"
echo "been merged into that remote's master branch."
exit 1
fi
@sadlerjw
sadlerjw / handbrake.sh
Created August 5, 2013 20:48
Shell script to do batch encoding using HandBrakeCLI. Automatically invokes HandBrakeCLI on each file passed in (you can also use BASH wildcards) and creates a new .m4v file (if one doesn't already exist). My script uses the "AppleTV 2" preset - just modify the script to use a different one.
#!/bin/bash
for f in "${@}"
do
if [ ! -f "${f%.*}.m4v" ]; then
HandBrakeCLI --preset="AppleTV 2" -i "$f" -o "${f%.*}.m4v"
else
echo "Skpping $f - already exists: ${f%.*}.m4v"
fi
done