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
| // Variables | |
| kb = [UIKeyboardImpl sharedInstance]; l = [kb _layout]; inputDelegate = [kb inputDelegate]; | |
| // Some subclass of UITextRange (WKTextRange) | |
| textRange = [inputDelegate selectedTextRange]; | |
| // Some subclass of UITextPosition (WKTextPosition) | |
| //start = [textRange start]; | |
| //end = [textRange end]; | |
| begin = [inputDelegate beginningOfDocument]; |
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
| /** | |
| What size and quailty youtube thumbnail you want. | |
| - Zero: Player Background: (480x360 pixels) (same as High) | |
| - One: Start: (120x90 pixels) | |
| - Two: Middle: (120x90 pixels) | |
| - Three: End: (120x90 pixels) | |
| - Default: Normal: (120x90 pixels) | |
| - Medium: Medium: (320x180 pixels) | |
| - High: High: (480x360 pixels) (same as 0) |
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
| // scheme://domain:port/path?query_string#fragment_id | |
| func cleanupURLString(urlString: String) -> String { | |
| var urlSubstring = urlString | |
| var protocolString:String? | |
| var userString:String? | |
| var passString:String? | |
| var hostString:String | |
| var portString:String? | |
| var pathString:String? |
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
| extension NSURL | |
| { | |
| @objc var queryDictionary:[String: [String]]? { | |
| get { | |
| if let query = self.query { | |
| var dictionary = [String: [String]]() | |
| for keyValueString in query.componentsSeparatedByString("&") { | |
| var parts = keyValueString.componentsSeparatedByString("=") | |
| if parts.count < 2 { continue; } |
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
| { | |
| "id":"1", | |
| "jsonrpc":"2.0", | |
| "result":{ | |
| "description":"JSON-RPC API of XBMC", | |
| "id":"http://xbmc.org/jsonrpc/ServiceDescription.json", | |
| "methods":{ | |
| "Addons.ExecuteAddon":{ | |
| "description":"Executes the given addon with the given parameters (if possible)", | |
| "params":[ |
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
| MRMediaRemoteGetNowPlayingInfo(dispatch_get_main_queue(), ^(CFDictionaryRef information) {}); | |
| /* [information allKeys] | |
| ( | |
| kMRMediaRemoteNowPlayingInfoTotalDiscCount, | |
| kMRMediaRemoteNowPlayingInfoShuffleMode, | |
| kMRMediaRemoteNowPlayingInfoTrackNumber, | |
| kMRMediaRemoteNowPlayingInfoDuration, | |
| kMRMediaRemoteNowPlayingInfoRepeatMode, | |
| kMRMediaRemoteNowPlayingInfoTitle, |
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
| cy# settings = [[SBActivationSettings alloc] init] | |
| #"<SBActivationSettings:0x17420c8a0> -> {}" | |
| cy# settings | |
| #"<SBActivationSettings:0x17420c8a0> -> {}" | |
| cy# [settings keyDescriptionForSetting:0] | |
| @"notASetting" | |
| cy# [settings keyDescriptionForSetting:1] | |
| @"noAnimate" | |
| cy# [settings keyDescriptionForSetting:2] | |
| @"animationDurationForOthersSuspension" |
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
| #!/bin/sh | |
| find . \( -iname "*.[chm]" -o -iname "*.swift" -o -iname "*.cpp" -o -iname "*.mm" -o -iname "*.xm" \) -print0 | xargs -0 cat | wc -l |
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
| // uint8_t *buffer [1] & [2] contain the uint16_t bytes. | |
| uint16_t duration; | |
| uint8_t* p = (uint8_t*)(void*)&duration; | |
| *p = buffer[1]; // 2e | |
| *(p+1) = buffer[2]; // e5 | |
| //duration now contains 2ee5 | |
| printf("duration: %d", duration); |
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
| // HomeKit UDID Name mapping | |
| cy# [HAKUUID nameMapping] | |
| @{ "00000014":"Identify", | |
| "FED0":"Lock Mechanism", | |
| "0000002F":"Saturation", | |
| "0000000B":"Camera Tilt", | |
| "00000017":"IP Camera Stop Session", | |
| "00000040":"Fan", | |
| "0000000E":"Current Door State", |