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 | |
@IBDesignable class PaddedLabel: UILabel { | |
@IBInspectable var topInset: CGFloat = 0.0 | |
@IBInspectable var bottomInset: CGFloat = 0.0 | |
@IBInspectable var leftInset: CGFloat = 0.0 | |
@IBInspectable var rightInset: CGFloat = 0.0 | |
func setAllInsets(_ inset : CGFloat){ |
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
#!/bin/bash | |
set -e | |
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/ "$1" stdout -l eng | xml esc) | |
hex=$((cat <<EOF | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> |
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
// Playground - noun: a place where people can play | |
import Foundation | |
func myFunc(String){ | |
// no way to access the value of the string passed in | |
} | |
// myFunc() // error | |
myFunc("Potato!") // works |
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
// Playground - noun: a place where people can play | |
class Abc | |
{ | |
} | |
class Def | |
{ | |
} |
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 <Foundation/Foundation.h> | |
@interface SomeClass : NSObject | |
-(BOOL)arrayHasStuff; | |
-(BOOL)otherArrayHasStuff; | |
@property (nonatomic, retain) NSArray *array; | |
@property (nonatomic, retain) NSArray *otherArray; |
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
(lldb) po label | |
<SKLabelNode> name:'(null)' text:'Total: 581' fontName:'Helvetica' position:{160, 286.5} | |
(lldb) po label.frame | |
error: type of property 'frame' ('CGRect') does not match type of accessor 'frame' ('<unknown type>') | |
error: unsupported expression with unknown type | |
error: instance method 'isPaused' has incompatible result types in different translation units ('char' vs. 'BOOL' (aka 'signed char')) | |
error: instance method 'scene' has incompatible result types in different translation units ('id' vs. 'SKScene *') | |
error: instance method 'physicsBody' has incompatible result types in different translation units ('id' vs. 'SKPhysicsBody *') | |
error: instance method 'isHidden' has incompatible result types in different translation units ('char' vs. 'BOOL' (aka 'signed char')) |
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
/// Syntactically correct usage: @"Hello ".append(@"World").append(@"!"); | |
@interface NSString (horrible) | |
-(NSString* (^)(NSString* appendedText))append; | |
@end | |
@implementation NSString (horrible) |