Skip to content

Instantly share code, notes, and snippets.

View Shilo's full-sized avatar

Shilo Shilo

View GitHub Profile
@Shilo
Shilo / Merge_Forked_Repo.sh
Created April 9, 2014 13:17
Terminal git commands to merge github original repo into forked repo.
git clone git@github.com:<your-gh-name>/<repo-name>.git <local-directory-path>
cd <local-directory-path>
git remote add upstream https://github.com/<original-gh-name>/<repo-name>.git
git pull upstream master
git push
@Shilo
Shilo / TimerMacros.m
Last active August 29, 2015 13:58
Objective-C macros for timing processes.
#define TIMER_START() CFAbsoluteTime timer_startTime = CFAbsoluteTimeGetCurrent();
#define TIMER_STOP() (CFAbsoluteTimeGetCurrent() - timer_startTime);
#define TIMER_STOP_AND_LOG(prefixString) CFAbsoluteTime timer_endTime = TIMER_STOP(); NSLog(@"%@%f", ((prefixString)?prefixString:@""), timer_endTime);
@Shilo
Shilo / Instructions.md
Last active August 29, 2015 13:59
AppleScript to hide iOS Simulator when you run Xcode Tests.
  1. Save Tests.scpt to the folder ~/.Xcode/
  2. Open the folder ~/.Xcode/ in Terminal.app
  3. Perform the command chmod +x ./Tests.scpt in Terminal.app
  4. Open Xcode ➭ Behaviors ➭ Testing Succeeds
  5. Choose ~/.Xcode/Tests.scpt in the Run popup
  6. Open Xcode ➭ Behaviors ➭ Testing Fails and repeat
@Shilo
Shilo / main.m
Created April 14, 2014 10:03
Objective-C code to run a blank app delegate on Test.
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
#import "TestAppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool
{
BOOL runningTests = (NSClassFromString(@"XCTestCase") != nil);
return UIApplicationMain(argc, argv, nil, NSStringFromClass((!runningTests?[AppDelegate class]:[TestAppDelegate class])));
@Shilo
Shilo / Trace_System_Log.sh
Created June 5, 2014 08:03
Terminal command to print system logs
tail -f /var/log/system.log
@Shilo
Shilo / Disable_Key_Accent_Menu.sh
Created June 6, 2014 10:13
Terminal command to disable keyboard character accent menu on key press and hold event.
defaults write -g ApplePressAndHoldEnabled -bool false
@Shilo
Shilo / Hide_Desktop_Icons.sh
Created June 6, 2014 10:17
Terminal command to hide all desktop icons on wallpaper only.
defaults write com.apple.finder CreateDesktop -bool false
killall Finder
@Shilo
Shilo / Website_Editable.js
Created June 6, 2014 11:05
Javascript to make any website editable.
javascript: document.body.contentEditable='true'; document.designMode='on'; void 0;
@Shilo
Shilo / Disable_App_Nap.sh
Created June 6, 2014 12:04
Terminal command to disable OS X Mavericks (10.9) "App Nap" feature for a specific application.
defaults write <app domain name> NSAppSleepDisabled -bool YES
@Shilo
Shilo / Terminal_Disable_App_Nap.sh
Created June 6, 2014 12:05
Terminal command to disable OS X Mavericks (10.9) "App Nap" feature for a specific application.
defaults write com.apple.Terminal NSAppSleepDisabled -bool YES