I've moved this gist to https://github.com/phynet/iOS-Schemes please check it there ;)
This file contains hidden or 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
// This is more hacky than it should be! | |
- (UIModalPresentationStyle)pspdf_currentPresentationStyle { | |
UIViewController *vc = self.presentedViewController.presentingViewController; | |
if ([self respondsToSelector:@selector(adaptivePresentationStyleForTraitCollection:)]) { | |
UIModalPresentationStyle const style = [self adaptivePresentationStyleForTraitCollection:vc.traitCollection]; | |
return (style == UIModalPresentationNone) ? self.presentationStyle : style; | |
} | |
// Before iOS 8.3 we have to fall back on assuming adaptivity is only possible for horizontally compact environments. |
This file contains hidden or 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
NS_ASSUME_NONNULL_BEGIN | |
void Log(NSString *foo) { | |
NSLog(@"%@", foo); | |
} | |
int main(int argc, const char * argv[]) { | |
@autoreleasepool { | |
NSDictionary *stuff = @{ | |
@"a": @"Test" |
This file contains hidden or 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
@import Foundation; | |
@interface ContravariantCollection<__contravariant ObjectType> : NSObject | |
@end | |
@implementation ContravariantCollection | |
@end | |
void stringSetThing(NSSet<NSString *> *set) { | |
} |
This file contains hidden or 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
http://itsliveradio.apple.com/streams/beats_one_demo_3/master.m3u8 | |
http://itsliveradio.apple.com/streams/beats_one_demo_3/master.m3u8 | |
http://itsliveradio.apple.com/streams/beats_one_demo_3/256/prog_index.m3u8 | |
http://itsliveradio.apple.com/streams/beats_one_demo_3/256/prog_index.m3u8 | |
http://itsliveradio.apple.com/streams/beats_one_demo_3/256/fileSequence0.aac | |
http://itsliveradio.apple.com/streams/beats_one_demo_3/256/fileSequence1.aac | |
http://itsliveradio.apple.com/streams/beats_one_demo_3/256/fileSequence2.aac | |
http://itsliveradio.apple.com/streams/beats_one_demo_3/256/fileSequence3.aac | |
http://itsliveradio.apple.com/streams/beats_one_demo_3/256/fileSequence4.aac | |
http://itsliveradio.apple.com/streams/beats_one_demo_3/256/fileSequence5.aac |
This file contains hidden or 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
import Foundation | |
extension NSCopying { | |
func copied() -> Self { | |
let copied = copyWithZone(nil) | |
assert(copied is Self, "Invalid downcast while copying instance of \(Self.self), did you mean to use 'as?'") | |
return unsafeDowncast(copied) | |
} |
This file contains hidden or 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
import QuartzCore | |
private func demunge(@noescape fn: CGPath.Element -> Void)(ptr: UnsafePointer<CGPathElement>) { | |
let points = ptr.memory.points | |
switch ptr.memory.type { | |
case kCGPathElementMoveToPoint: | |
fn(.Move(to: points[0])) | |
case kCGPathElementAddLineToPoint: | |
fn(.Line(to: points[0])) | |
case kCGPathElementAddQuadCurveToPoint: |
This file contains hidden or 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
// Inspired by this article: http://blogs.msdn.com/b/oldnewthing/archive/2008/01/10/7047497.aspx | |
// which explains the weird behavior of the percent key on calculators | |
// We will demonstrate using the stack like a calculator | |
// to calculate (150 + 1000) - 10% = (150 + 1000) * (1 - 10/100) = 1035 | |
var stack = Stack() // [] | |
stack.push(150) // [150] | |
stack.push(1000) // [150, 1000] | |
stack.push(add) // [150, 1000, add] | |
stack.push(10) // [150, 1000, add, 10] |
This file contains hidden or 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
/System/Library/AccessibilityBundles/AXSpeechImplementation.bundle/AXSpeechImplementation | |
/System/Library/AccessibilityBundles/AccessibilitySettingsLoader.bundle/AccessibilitySettingsLoader | |
/System/Library/AccessibilityBundles/MapKitFramework.axbundle/MapKitFramework | |
/System/Library/AccessibilityBundles/UIKit.axbundle/UIKit | |
/System/Library/BulletinBoardPlugins/NanoMailDataProvider.bundle/NanoMailDataProvider | |
/System/Library/BulletinBoardPlugins/SMSBBPlugin.bundle/SMSBBPlugin | |
/System/Library/Caches/com.apple.xpc//sdk.dylib | |
/System/Library/Caches/com.apple.xpcd/xpcd_cache.dylib | |
/System/Library/CoreServices/Encodings/libArabicConverter.dylib | |
/System/Library/CoreServices/Encodings/libCyrillicConverter.dylib |
This file contains hidden or 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/env ruby | |
# modified from https://gist.github.com/pbock/3ab260f3862c350e6b5f # | |
require 'watir-webdriver' | |
class BurgerBot | |
def initialize | |
@attempt_count = 0 |