Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
| - (UIViewController *)topViewController{ | |
| return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController]; | |
| } | |
| - (UIViewController *)topViewController:(UIViewController *)rootViewController | |
| { | |
| if (rootViewController.presentedViewController == nil) { | |
| return rootViewController; | |
| } | |
| CIFilter *resizeFilter = [CIFilter filterWithName:@"CILanczosScaleTransform"]; | |
| [resizeFilter setValue:ciImage forKey:@"inputImage"]; | |
| [resizeFilter setValue:[NSNumber numberWithFloat:1.0f] forKey:@"inputAspectRatio"]; | |
| [resizeFilter setValue:[NSNumber numberWithFloat:xRatio] forKey:@"inputScale"]; | |
| CIFilter *cropFilter = [CIFilter filterWithName:@"CICrop"]; | |
| CIVector *cropRect = [CIVector vectorWithX:rect.origin.x Y:rect.origin.y Z:rect.size.width W:rect.size.height]; | |
| [cropFilter setValue:resizeFilter.outputImage forKey:@"inputImage"]; | |
| [cropFilter setValue:cropRect forKey:@"inputRectangle"]; | |
| CIImage *croppedImage = cropFilter.outputImage; |
| # Copyright (C) 2013 Wesley Baugh | |
| """Tools for text classification. | |
| Extracted from the [infer](https://github.com/bwbaugh/infer) library. | |
| """ | |
| from __future__ import division | |
| import math | |
| from collections import defaultdict, namedtuple, Counter | |
| from fractions import Fraction |
| // Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
| // Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
| // Licensed under MIT (http://opensource.org/licenses/MIT) | |
| // | |
| // You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
| // PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit. | |
| #import <objc/runtime.h> | |
| #import <objc/message.h> |
| #if TARGET_IPHONE_SIMULATOR | |
| #pragma clang diagnostic push | |
| #pragma clang diagnostic ignored "-Wimplicit" | |
| // Log all notifications via tail -f /tmp/msgSends-* | |
| instrumentObjcMessageSends(YES); | |
| #pragma clang diagnostic pop | |
| #endif |
| http://devstreaming.apple.com/videos/wwdc/2013/710xfx3xn8197k4i9s2rvyb/710/710-HD.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2013/202xdx2x47ezp1wein/202/202-HD.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2013/200xdx2x35e1pxiinm/200/200-HD.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2013/413xdx5x97itb5ek4yex3r7/413/413-HD.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2013/612xax4xx65z1ervy5np1qb/612/612-HD.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2013/221xex4xxohbllf4hblyngt/221/221-HD.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2013/220xbx4xipaxfd1tggxuoib/220/220-HD.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2013/711xcx4x8yuutk8sady6t9f/711/711-HD.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2013/404xbx2xvp1eaaqonr8zokm/404/404-HD.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2013/505xbx4xrgmhwby4oiwkrpp/505/505-HD.mov?dl=1 |
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
| // Taken from http://PSPDFKit.com. This snippet is under public domain. | |
| #define UIKitVersionNumber_iOS_7_0 0xB57 | |
| BOOL PSPDFIsUIKitFlatMode(void) { | |
| static BOOL isUIKitFlatMode = NO; | |
| static dispatch_once_t onceToken; | |
| dispatch_once(&onceToken, ^{ | |
| // We get the modern UIKit if system is running >= iOS 7 and we were linked with >= SDK 7. | |
| if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) { | |
| isUIKitFlatMode = (NSVersionOfLinkTimeLibrary("UIKit") >> 16) >= UIKitVersionNumber_iOS_7_0; | |
| } |
| //Install Macports. | |
| //Install aircrack-ng: | |
| sudo port install aircrack-ng | |
| //Install the latest Xcode, with the Command Line Tools. | |
| //Create the following symlink: | |
| sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport | |
| //Figure out which channel you need to sniff: | |
| sudo airport -s | |
| sudo airport en1 sniff [CHANNEL] |
| NEW_VER="0.33.1" | |
| POD_VER=`pod --version 2>/dev/null`|| POD_VER=`~/.rbenv/shims/pod --version 2>/dev/null` | |
| if [[ "$POD_VER" != *$NEW_VER ]]; then | |
| echo "error: WTF! You MUST upgrade cocoapods!!!" | |
| exit 1 | |
| fi |