Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
POST /osc/commands/execute | |
{ | |
"name": "camera.startSession", | |
"parameters": {} | |
} | |
#shoot | |
192.168.1.1/osc/commands/execute | |
{ | |
"name": "camera.takePicture", |
// direct check for external keyboard | |
+ (BOOL)_isExternalKeyboardAttached | |
{ | |
BOOL externalKeyboardAttached = NO; | |
@try { | |
NSString *keyboardClassName = [@[@"UI", @"Key", @"boa", @"rd", @"Im", @"pl"] componentsJoinedByString:@""]; | |
Class c = NSClassFromString(keyboardClassName); | |
SEL sharedInstanceSEL = NSSelectorFromString(@"sharedInstance"); | |
if (c == Nil || ![c respondsToSelector:sharedInstanceSEL]) { |
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
user jessed staff; | |
worker_processes 2; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; |
@implementation AppDelegate | |
void SwapMethodImplementations(Class cls, SEL left_sel, SEL right_sel) { | |
Method leftMethod = class_getInstanceMethod(cls, left_sel); | |
Method rightMethod = class_getInstanceMethod(cls, right_sel); | |
method_exchangeImplementations(leftMethod, rightMethod); | |
} | |
+ (void)initialize { | |
if (self == [AppDelegate class]) { | |
#ifdef __IPHONE_6_0 |
########################################## | |
# | |
# c.f. http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4 | |
# | |
# Version 2.82 | |
# | |
# Latest Change: | |
# - MORE tweaks to get the iOS 10+ and 9- working | |
# - Support iOS 10+ | |
# - Corrected typo for iOS 1-10+ (thanks @stuikomma) |
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES; | |
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled; | |
// by the way, you need to logout and log back in for this to take effect. Or at least that's what | |
// Quartz Debug says. Who knows, maybe it's lying? | |
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging | |
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from. |
var GO = 'GO', | |
OK = 'OK', | |
SIGN = 'SIGN', | |
LZERO = 'LZERO', | |
INT = 'INT', | |
FRAC = 'FRAC', | |
FDIG = 'FDIG', | |
EXP = 'EXP', | |
XSIGN = 'XSIGN', | |
EDIG = 'EDIG', |
framework 'Cocoa' | |
class NSColor | |
def toCGColor | |
color_RGB = colorUsingColorSpaceName(NSCalibratedRGBColorSpace) | |
## approach #1 | |
# components = Array.new(4){Pointer.new(:double)} | |
# color_RGB.getRed(components[0], | |
# green: components[1], | |
# blue: components[2], |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Thiemo Mättig <http://maettig.com/> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |