This file contains 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
// | |
// KHEventQueue.h | |
// | |
// Created by Kyle Howells on 04/08/2014. | |
// Copyright (c) 2014 Kyle Howells. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
typedef void (^KHEventBlock)(void); |
This file contains 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
//SpringBoard | |
-(void)_reloadDemoAndDebuggingDefaultsAndCapabilities{ | |
//..Blah blah, setting stuff up, etc.., etc... | |
// Control Centre gesture | |
SBOffscreenSwipeGestureRecognizer *gesture = [[SBOffscreenSwipeGestureRecognizer alloc] initForOffscreenEdge:0x4]; | |
[gesture setTypes:0x40]; | |
[gesture setShouldUseUIKitHeuristics:YES]; |
This file contains 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
// Function signature | |
void (*KH_BKSTerminateApplicationForReasonAndReportWithDescription)(NSString *app, int a, int b, NSString *description) = NULL; | |
// Find the Symbol. | |
if (KH_BKSTerminateApplicationForReasonAndReportWithDescription == NULL) { | |
// dlopen Handle | |
void* handle = dlopen(0,RTLD_NOW|RTLD_GLOBAL); | |
// Load the function to our pointer | |
KH_BKSTerminateApplicationForReasonAndReportWithDescription = dlsym(handle, "BKSTerminateApplicationForReasonAndReportWithDescription"); | |
} |
This file contains 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
-(NSString*)stringForTimeInSeconds:(NSInteger)time{ | |
NSInteger seconds = time % 60; | |
NSInteger minutes = (time - seconds) / 60; | |
NSInteger hours = floorl(minutes / 60); | |
if (hours > 0) { | |
minutes -= (hours * 60); | |
return [NSString stringWithFormat:@"%ld:%ld:%.2ld", (long)hours, (long)minutes, (long)seconds]; | |
} | |
return [NSString stringWithFormat:@"%ld:%.2ld", (long)minutes, (long)seconds]; |
This file contains 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
[[SBWallpaperController sharedInstance] beginRequiringWithReason:@"Switcher Showing"]; | |
[[SBWallpaperController sharedInstance] endRequiringWithReason:@"Switcher Showing"]; |
This file contains 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
var string = "plugin://plugin.video.youtube/?action=play_video&videoid=WnlLQbAQSxQ" | |
var params = { | |
item : { | |
file : string | |
} | |
} | |
var data = { jsonrpc: "2.0", method: "Player.Open", id: 1 }; | |
data.params = params; |
This file contains 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
/// Accepts any of the following formats | |
// | |
// - The Youtube ID itself: | |
// 1. yj4OtpHl8EE | |
// | |
// - A youtu.be short URL: | |
// 2. http://youtu.be/yj4OtpHl8EE | |
// | |
// - A normal youtube.com URL: | |
// 3. http://www.youtube.com/watch?v=ZvmMzI0X7fE |
This file contains 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
-(void)viewDidAppear:(BOOL)animated{ | |
CGFloat _expandedHeight = 500; | |
NSLayoutConstraint *_heightConstraint = | |
[NSLayoutConstraint constraintWithItem: self.view | |
attribute: NSLayoutAttributeHeight | |
relatedBy: NSLayoutRelationEqual | |
toItem: nil | |
attribute: NSLayoutAttributeNotAnAttribute | |
multiplier: 0.0 constant: _expandedHeight]; | |
[self.view addConstraint: _heightConstraint]; |
This file contains 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
on run {input, parameters} | |
tell application "System Events" | |
keystroke (the clipboard as text) | |
end tell | |
return input | |
end run |
This file contains 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]; |
OlderNewer