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
# 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) |
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
#To visualize branches: | |
git branch | |
#To create a new branch: | |
git branch testbranch | |
#To change to created branch: | |
git checkout testbranch | |
#Track new files: |
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
typedef enum _UIBackgroundStyle { | |
UIBackgroundStyleDefault, | |
UIBackgroundStyleTransparent, | |
UIBackgroundStyleLightBlur, | |
UIBackgroundStyleDarkBlur, | |
UIBackgroundStyleDarkTranslucent | |
} UIBackgroundStyle; | |
@interface UIApplication (UIBackgroundStyle) | |
-(void)_setBackgroundStyle:(UIBackgroundStyle)style; |
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
// 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. |
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
# ~/.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 |
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
# 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 |
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
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, | |
] |
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
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 } |
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
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 */ |
OlderNewer