Forked from here, but let's use Markdown.
⌘Tgo to file⌘⌃Pgo to project⌘Rgo to methods⌃Ggo to line
| <?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>DVTConsoleDebuggerInputTextColor</key> | |
| <string>0.052 0.489 0.482 1</string> | |
| <key>DVTConsoleDebuggerInputTextFont</key> | |
| <string>Menlo-Bold - 11.0</string> | |
| <key>DVTConsoleDebuggerOutputTextColor</key> | |
| <string>0.432 0.325 0.276 1</string> |
| // | |
| // UIDeviceHardware.h | |
| // | |
| // Used to determine EXACT version of device software is running on. | |
| #import <Foundation/Foundation.h> | |
| @interface UIDeviceHardware : NSObject | |
| - (NSString *) platform; |
Forked from here, but let's use Markdown.
⌘T go to file⌘⌃P go to project⌘R go to methods⌃G go to line| #!/bin/sh | |
| #ID='A16FF353-8441-459E-A50C-B071F53F51B7' # Xcode 6.2 | |
| ID='992275C1-432A-4CF7-B659-D84ED6D42D3F' # Xcode 6.3 | |
| PLIST_BUDDY=/usr/libexec/PlistBuddy | |
| function add_compatibility() { | |
| "$PLIST_BUDDY" -c "Add DVTPlugInCompatibilityUUIDs:10 string $2" \ | |
| "$1/Contents/Info.plist" |
| // put this in your AppDelegate | |
| - (void)changeRootViewController:(UIViewController*)viewController { | |
| if (!self.window.rootViewController) { | |
| self.window.rootViewController = viewController; | |
| return; | |
| } | |
| UIView *snapShot = [self.window snapshotViewAfterScreenUpdates:YES]; | |
| [viewController.view addSubview:snapShot]; | |
| self.window.rootViewController = viewController; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/usr/bin/env ruby | |
| device_types_output = `xcrun simctl list devicetypes` | |
| device_types = device_types_output.scan /(.*) \((.*)\)/ | |
| runtimes_output = `xcrun simctl list runtimes` | |
| runtimes = runtimes_output.scan /(.*) \(.*\) \((com.apple[^)]+)\)$/ | |
| devices_output = `xcrun simctl list devices` | |
| devices = devices_output.scan /\s\s\s\s(.*) \(([^)]+)\) (.*)/ |
| static NSData *PSPDFCalculateSHA256FromFileURL(NSURL *fileURL, CC_LONG dataLength, NSError **error) { | |
| NSCParameterAssert(fileURL); | |
| dispatch_queue_t shaQueue = dispatch_queue_create("com.pspdfkit.sha256-queue", DISPATCH_QUEUE_SERIAL); | |
| __block dispatch_io_t readChannel; | |
| void (^processIntError)(int intError) = ^(int intError) { | |
| if (intError != 0) { | |
| PSPDFLogWarning(@"Stream error: %d", intError); | |
| if (error) *error = [NSError errorWithDomain:@"SHA256Error" code:100 userInfo:@{NSLocalizedDescriptionKey: @"failed to open file for calculating SHA256."}]; |
| static NSData *PSPDFCalculateSHA256FromFileURL(NSURL *fileURL, CC_LONG dataLength, NSError **error) { | |
| NSCParameterAssert(fileURL); | |
| NSData *shaData; | |
| int fd = open(fileURL.path.UTF8String, O_RDONLY); | |
| if (fd < 0) { | |
| if (error) *error = [NSError pspdf_errorWithCode:PSPDFErrorCodeUnableToOpenPDF description:@"Failed to open file for calculating SHA256."]; | |
| return nil; | |
| } |
| [ | |
| { "keys": ["super+0"], "command": "toggle_side_bar" }, | |
| { "keys": ["super+shift+o"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} }, | |
| { "keys": ["super+shift+y"], "command": "show_panel", "args": {"panel": "console", "toggle": true} }, | |
| { | |
| "keys": ["super+enter"], | |
| "command": "set_layout", | |
| "args": | |
| { | |
| "cols": [0.0, 1.0], |