Skip to content

Instantly share code, notes, and snippets.

View ebruning's full-sized avatar

Ethan Bruning ebruning

View GitHub Profile
@ebruning
ebruning / gist:6084205
Created July 25, 2013 22:03
Restart application
http://stackoverflow.com/questions/5082738/ios-calling-app-delegate-method-from-viewcontroller
http://stackoverflow.com/questions/4399611/force-iphone-app-to-restart-programmatically
// call delegate method
MainClass *appDelegate = (MainClass *)[[UIApplication sharedApplication] delegate];
[appDelegate.viewController resetAppToFirstController];
- (void)resetAppToFirstController
{
  • Buy a mac mini
  • Install 10.8
  • Create a user account for Jenkins
  • Install xcode
  • Turn on screen sharing
  • Turn off energy save sleeping
  • Login as your jenkins user
  • Use ssh-keygen to create a key for github
  • Create a github account for your build machine
  • Add the key to your build machine github account
@ebruning
ebruning / animate_buttons
Created July 16, 2013 17:37
animate buttons
CATransition *animation = [CATransition animation];
animation.type = kCATransitionFade;
animation.duration = 0.4;
[[self.view viewWithTag:Capture].layer addAnimation:animation forKey:nil];
[self.view viewWithTag:Capture].hidden = false;
[[self.view viewWithTag:Submit].layer addAnimation:animation forKey:nil];
[self.view viewWithTag:Submit].hidden = false;
@ebruning
ebruning / gist:3174476
Created July 25, 2012 04:54
Change home and end keys Mac OSX
http://www.samuelhwong.com/blog/2011/08/29/remapping-keyboard-and-mouse-in-mac-os-x-lion/
~/Library/KeyBindings/DefaultKeyBinding.dict
{
/* Remap Home / End to be correct */
"\UF729" = "moveToBeginningOfLine:"; /* Home */
"\UF72B" = "moveToEndOfLine:"; /* End */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* Shift + End */
@ebruning
ebruning / gist:3137894
Created July 18, 2012 18:26
Command line to mute/unmute the volume
Much more geeky (and gratifying) to set up a Cron event to send this command:
osascript -e "set Volume 0"
And one to set it back:
osascript -e "set Volume 10"
http://lifehacker.com/5926577/silencer-mutes-and-unmutes-your-mac-on-a-schedule-every-day
@ebruning
ebruning / file_mode.txt
Created June 11, 2012 20:08
Stop tracking file modes in git
Solution
Luckily, the solution is very simple – tell git to stop tracking filemodes! I set this as a global option, but also had to set it on the repository too as it has a default value set in there. The following two commands sorted it out:
git config --global core.filemode false
git config core.filemode false
http://www.grumpydev.com/2011/01/19/switching-from-cygwin-to-msysgit-git-thinks-everything-has-been-modified/
@ebruning
ebruning / gist:2430066
Created April 20, 2012 16:16
Launch html file in sublime
Mac
"cmd": ["open", "-a", "Google Chrome", "$file"]
Windows
"cmd": ["PATH_TO_YOUR_CHROME", "$file"]
http://stackoverflow.com/questions/8023879/sublime-text-2-keyboard-shortcut-to-open-file-in-chrome
@ebruning
ebruning / gist:2387917
Created April 14, 2012 21:16
Mac Java_Home
/Library/Java/Home/
@ebruning
ebruning / combine_array.cs
Created January 18, 2012 00:06
combine an array
private readonly List<string> authors = new List<string>
{
"Cameron MacFarland",
"Mike Minutillo",
"Jake Ginnivan",
"Ian Randall",
"Paul Stovell",
"Andrew Tobin",
"Brendan Forster",
"Paul Jenkins"
@ebruning
ebruning / web_fonts.txt
Created December 30, 2011 19:17
List of fonts I like
Abel
Open Sans