This is a guide for aligning images.
See the full Advanced Markdown doc for more tips and tricks
| # iOS builds for ARMv7 and simulator i386. | |
| # Assumes any dependencies are in a local folder called libs and | |
| # headers in a local folder called headers. | |
| # Dependencies should already have been compiled for the target arch. | |
| PROJ=untitled | |
| ifeq ($(IOS), 1) | |
| ARCH=armv7 | |
| DEVICE=OS | |
| CC_FLAGS=-arch $(ARCH) |
| #To visualize branches: | |
| git branch | |
| #To create a new branch: | |
| git branch testbranch | |
| #To change to created branch: | |
| git checkout testbranch | |
| #Track new files: |
| typedef enum _UIBackgroundStyle { | |
| UIBackgroundStyleDefault, | |
| UIBackgroundStyleTransparent, | |
| UIBackgroundStyleLightBlur, | |
| UIBackgroundStyleDarkBlur, | |
| UIBackgroundStyleDarkTranslucent | |
| } UIBackgroundStyle; | |
| @interface UIApplication (UIBackgroundStyle) | |
| -(void)_setBackgroundStyle:(UIBackgroundStyle)style; |
| // alterkeys.c | |
| // http://osxbook.com | |
| // | |
| // Complile using the following command line: | |
| // gcc -Wall -o alterkeys alterkeys.c -framework ApplicationServices | |
| // | |
| // You need superuser privileges to create the event tap, unless accessibility | |
| // is enabled. To do so, select the "Enable access for assistive devices" | |
| // checkbox in the Universal Access system preference pane. |
| # ~/.lldbinit-Xcode | |
| # Apple private methods | |
| command regex ivars 's/(.+)/po [%1 _ivarDescription]/' | |
| command regex methods 's/(.+)/po [%1 _methodDescription]/' | |
| command regex shortmethods 's/(.+)/po [%1 _shortMethodDescription]/' | |
| command regex nextviewcontroller 's/(.+)/po [%1 _nextViewControllerInResponderChain]/' | |
| command alias nextvc nextviewcontroller | |
| # Convenience |
| # View on GitHub: https://github.com/sharplet/Switch | |
| # Try it yourself: git clone https://github.com/sharplet/Switch.git && cd Switch && rake | |
| $ rake | |
| mkdir -p Build | |
| mkdir -p Build/Switch.framework | |
| mkdir -p Build/Switch.framework/Versions/A/Modules/Switch.swiftmodule | |
| ln -sf A Build/Switch.framework/Versions/Current | |
| ln -sf Versions/Current/Modules Build/Switch.framework/Modules | |
| ln -sf Versions/Current/Switch Build/Switch.framework/Switch | |
| xcrun -sdk macosx swiftc -module-name Switch -emit-library -o Build/Switch.framework/Versions/Current/Switch -- Source/Array+Ext.swift Source/Option.swift Source/ParseResult.swift Source/Parser.swift Source/String+Ext.swift |
| let styles: [UIFont.TextStyle] = [ | |
| // iOS 17 | |
| .extraLargeTitle, .extraLargeTitle2, | |
| // iOS 11 | |
| .largeTitle, | |
| // iOS 9 | |
| .title1, .title2, .title3, .callout, | |
| // iOS 7 | |
| .headline, .subheadline, .body, .footnote, .caption1, .caption2, | |
| ] |
| import UIKit | |
| public extension UIDevice { | |
| var modelName: String { | |
| var systemInfo = utsname() | |
| uname(&systemInfo) | |
| let machineMirror = Mirror(reflecting: systemInfo.machine) | |
| let identifier = machineMirror.children.reduce("") { identifier, element in | |
| guard let value = element.value as? Int8 where value != 0 else { return identifier } |
| NSMutableArray *commands = [[NSMutableArray alloc] init]; | |
| NSString *characters = @"`1234567890-=qwertyuiop[]asdfghjkl;'zxcvbnm,./"; | |
| for (NSInteger i = 0; i < characters.length; i++) { | |
| NSString *input = [characters substringWithRange:NSMakeRange(i, 1)]; | |
| /* Caps Lock */ | |
| [commands addObject:[UIKeyCommand keyCommandWithInput:input modifierFlags:UIKeyModifierAlphaShift action:@selector(handleCommand:)]]; | |
| /* Shift */ | |
| [commands addObject:[UIKeyCommand keyCommandWithInput:input modifierFlags:UIKeyModifierShift action:@selector(handleCommand:)]]; | |
| /* Control */ |
This is a guide for aligning images.
See the full Advanced Markdown doc for more tips and tricks