This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"kitIndex":4,"effectIndex":3,"tempo":100,"swingFactor":0,"effectMix":0,"kickPitchVal":0.23913043478260865,"snarePitchVal":0.45070422535211263,"hihatPitchVal":1,"tom1PitchVal":0.7183098591549295,"tom2PitchVal":0.704225352112676,"tom3PitchVal":0.8028169014084507,"rhythm1":[2,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0],"rhythm2":[0,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0],"rhythm3":[1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0],"rhythm4":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"rhythm5":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"rhythm6":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Input | |
void a() { | |
NSNumber *n = @42; | |
(void)n; | |
} | |
void b() { | |
NSNumber *n = [[NSNumber alloc] initWithInt:42]; | |
(void)n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Enable 9:41 AM status bar override for easy promo screenshot creation. Works on both device and in simulator | |
NSInteger (*SBSSpringBoardServerPort)() = dlsym(RTLD_NEXT, "SBSSpringBoardServerPort"); | |
NSInteger (*SBSetShowsOverridesForRecording)(NSInteger, NSInteger) = dlsym(RTLD_NEXT, "SBSetShowsOverridesForRecording"); | |
SBSetShowsOverridesForRecording(SBSSpringBoardServerPort(), 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>Xcode-ish</string> | |
<key>settings</key> | |
<array> | |
<dict> | |
<key>settings</key> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Due to an issue with the App Sandbox, Pixel Winch 1.0 will crash when the user | |
# attempts to save a screenshot or import an image. I'm submitting 1.0.1 immediately | |
# to fix this. | |
# | |
# In the meantime, if you need save/import functionality, a workaround is to disable the App Sandbox | |
# for Pixel Winch entirely: | |
defaults write /tmp/disable_sandbox.plist com.apple.security.app-sandbox -bool false | |
sudo codesign -f --entitlements /tmp/PixelWinchFix.plist -s - /Applications/Pixel\ Winch.app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See chart at http://www.midi.org/techspecs/midimessages.php | |
function handleMIDIMessage(message) | |
{ | |
var status = message.data[0]; | |
var note = message.data[1]; | |
var velocity = message.data[2]; | |
var type = status >> 4; | |
var channel = status & 0xf; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern UIAlertController *MakeAlert(NSString *title, NSString *message, NSString *cancelText, NSString *confirmText, void (^confirmBlock)(BOOL confirmed)); | |
extern UIAlertController *MakeAlert(NSString *title, NSString *message, NSString *cancelText, NSString *confirmText, void (^confirmBlock)(BOOL confirmed)) | |
{ | |
UIAlertController *result = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert]; | |
if (!confirmText) confirmText = NSLocalizedString(@"OK", nil); | |
if (!cancelText) cancelText = NSLocalizedString(@"Cancel", nil); | |
[result addAction:[UIAlertAction actionWithTitle:cancelText style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IXDebugTouchEvents() will flash the view that receives a touch event | |
BOOL IXSwizzleMethod(Class cls, SEL selA, SEL selB) | |
{ | |
Method methodA = class_getInstanceMethod(cls, selA); | |
if (!methodA) return NO; | |
Method methodB = class_getInstanceMethod(cls, selB); | |
if (!methodB) return NO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// How to push a portrait-only UIViewController onto a landscape UINavigationController | |
- (void) _presentForcedVerticalNormalViewController:(UIViewController *)viewController animated:(BOOL)animated | |
{ | |
UIView *(^makeSnapshotOfViewController)(UIViewController *) = ^(UIViewController *vc) { | |
UIView *result = [[vc view] snapshotViewAfterScreenUpdates:NO]; | |
[[_rootViewController view] addSubview:result]; | |
[result setFrame:[[vc view] bounds]]; | |
[result setUserInteractionEnabled:NO]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require "json" | |
all_strings = [ ] | |
`find . -path "*en.lproj*/*.strings"`.each_line do |line| | |
JSON.parse(`plutil -convert json -o - \"#{line.chop}\"`).each_value do |value| | |
all_strings.push(value.strip) | |
end |
OlderNewer