Key/Command | Description |
---|---|
Tab | Auto-complete files and folder names |
Ctrl + A | Go to the beginning of the line you are currently typing on |
Ctrl + E | Go to the end of the line you are currently typing on |
Ctrl + U | Clear the line before the cursor |
Ctrl + K | Clear the line after the cursor |
Ctrl + W | Delete the word before the cursor |
Ctrl + T | Swap the last two characters before the cursor |
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
// | |
// MakeTransparentHoleOnOverlayView.swift | |
// | |
// Created by James Laurenstin on 2015-04-10. | |
// Copyright (c) 2015 Aldo Group Inc. All rights reserved. | |
// | |
import UIKit | |
class MakeTransparentHoleOnOverlayView: UIView { |
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
/** | |
* A one color image. | |
* @param width | |
* @param height | |
* @param color | |
* @return A one color image with the given width and height. | |
*/ | |
public static Bitmap createImage(int width, int height, int color) { | |
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); | |
Canvas canvas = new Canvas(bitmap); |
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
/* | |
This is an update to an example found on http://www.jairobjunior.com/blog/2016/03/05/how-to-rotate-only-one-view-controller-to-landscape-in-ios-slash-swift/ | |
The code there works, with some updating to the latest Swift, but the pattern isn't very Swifty. The following is what I found to be more helpful. | |
*/ | |
/* | |
First, create a protocol that UIViewController's can conform to. | |
This is in opposition to using `Selector()` and checking for the presence of an empty function. | |
*/ |
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
/* Allow Landscape mode for specific ViewControllers */ | |
-(UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { | |
UIViewController* topVC = [self topViewControllerWith: self.window.rootViewController]; | |
if ([topVC respondsToSelector:@selector(canRotate)]) { | |
return UIInterfaceOrientationMaskAllButUpsideDown; | |
} | |
return UIInterfaceOrientationMaskPortrait; | |
} | |
/* get the top ViewController */ |
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
/* | |
Swift Programming Language Guide | |
"A Swift Tour" Solutions | |
https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/GuidedTour.html#//apple_ref/doc/uid/TP40014097-CH2-XID_1 | |
These are the solutions to all the "experiments" in the pre-release Swift Programming Guide | |
(released on the same day Apple announced Swift). A couple of things worth noting: | |
1. Swift syntax, e.g. array declarations, has changed since I releasd these. So this code will | |
probably cause some errors when you paste it into a playground. Should be easy enough to fix |
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
// 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> |
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)observeJSContext | |
{ | |
CFRunLoopRef runLoop = CFRunLoopGetCurrent(); | |
// This is a idle mode of RunLoop, when UIScrollView scrolls, it jumps into "UITrackingRunLoopMode" | |
// and won't perform any cache task to keep a smooth scroll. | |
CFStringRef runLoopMode = kCFRunLoopDefaultMode; | |
CFRunLoopObserverRef observer = CFRunLoopObserverCreateWithHandler | |
(kCFAllocatorDefault, kCFRunLoopBeforeWaiting, true, 0, ^(CFRunLoopObserverRef observer, CFRunLoopActivity _) { |
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) updateCountdown { | |
NSTimeInterval timeToClosing = [_deleteDate timeIntervalSinceDate:[NSDate date]]; | |
div_t h = div(timeToClosing, 3600); | |
int hours = h.quot; | |
div_t m = div(h.rem, 60); | |
int minutes = m.quot; | |
int seconds = m.rem; | |
NSString *hoursStr, *minutesStr, *secondsStr; |
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
#apks | |
glob:*.apk | |
glob:*.ap_ | |
# files for the dex VM | |
glob:*.dex | |
# Java class files | |
glob:*.class |
NewerOlder