Skip to content

Instantly share code, notes, and snippets.

@Sahil
Sahil / gist:6469564
Created September 6, 2013 20:30
RECRUITING 101
I am contacting you for a couple of reasons:
1.) You have a Purdue CS degree.
2.) You told me not to contact you.
3.) You obviously like iOS stuff - http://stackoverflow.com/users/53835/sahil
4.) Your website is INCREDIBLE: http://sahild.com/
@Sahil
Sahil / fix_airplay.sh
Created June 2, 2013 00:13
Kill coreaudiod process to fix issue with 10.8 where AirPlay refuses to be selected as the desired audio output source. this is far better than restart your router or computer (which so far have seemed to be the only other options). This works with my MBP 13" Retina + ATV3
#!/bin/bash
sudo kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'`
@Sahil
Sahil / SDUtils.h
Created April 27, 2012 20:27
Easier way to create a UIViewAutoresizing mask
// the last param must be NSNotFound
+ (UIViewAutoresizing)autoresizeWithMask:(UIViewAutoresizing)firstMask, ... {
va_list args;
va_start(args, firstMask);
UIViewAutoresizing autoresizingMask = UIViewAutoresizingNone;
for (UIViewAutoresizing nextMask = firstMask; nextMask != NSNotFound; nextMask = va_arg(args, UIViewAutoresizing)) {
autoresizingMask |= nextMask;
}
va_end(args);
return autoresizingMask;