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
// | |
// Tweak.m | |
// FLEXing | |
// | |
// Created by Tanner Bennett on 2016-07-11 | |
// Copyright © 2016 Tanner Bennett. All rights reserved. | |
// | |
#import "Interfaces.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
import Cocoa | |
public class Model { | |
public init() {} | |
public var className: NSString? | |
public var superclassName: NSString? | |
public var categoryname: NSString? | |
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
// | |
// Copyright © 2016 Tanner Bennett. All rights reserved. | |
// | |
import Foundation | |
typealias ResponseParserBlock = (ResponseParser) -> Void | |
class ResponseParser { | |
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
#define StaticNSArray(name, ...) nil; static dispatch_once_t ___onceToken; dispatch_once(&___onceToken, ^{ name = @[__VA_ARGS__]; }) | |
- (void)foo { | |
... | |
static NSArray *animals = StaticNSArray(typeQualifiers, @"cat", @"dog", @"bunny"); | |
... | |
} |
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; | |
@interface NSString (Markdown) | |
@property (nonatomic, readonly) NSAttributedString *attributedStringFromRawMarkdown; | |
@property (nonatomic, readonly) NSString *HTMLFromRawMarkdown; | |
@end |
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
# Assumes the `unsign` binary is in your PATH. | |
# https://github.com/steakknife/unsign | |
# | |
# (Download zip, run `make`, move the generated binary to /usr/bin) | |
# Remove Xcode code signature, backup stored as Xcode.signed | |
xcunsign() { | |
_xcode=/Applications/Xcode.app/Contents/MacOS/Xcode | |
# Is Xcode installed? |
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 FindProxyForURL(url, host) { | |
return "SOCKS 10.63.19.184:8081"; | |
} |
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> | |
#import <objc/runtime.h> | |
#define Method(sel, cls) class_getInstanceMethod(cls, sel) | |
#define originalIMP(m) method_getImplementation(m) | |
#define NSMethodSignatureOfMethod(m) [NSMethodSignature signatureWithObjCTypes:method_getTypeEncoding(m)] | |
#define swizzle(m, imp) method_setImplementation(m, imp) | |
typedef NS_ENUM(NSUInteger, TypeEncoding) |
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 | |
typealias JSON = [String: Any] | |
// For joining Dictionaries; contents of `right` take preceedence over `left` | |
func + <K,V> (left: Dictionary<K,V>, right: Dictionary<K,V>?) -> Dictionary<K,V> { | |
guard let right = right else { return left } | |
var left = left | |
right.forEach { key, value in |
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
// Tanner Bennett 2016 | |
import Foundation | |
typealias JSON = [String: Any] | |
/// For joining dictionaries; contents of `right` take preceedence over `left` | |
func + <K,V> (left: Dictionary<K,V>, right: Dictionary<K,V>?) -> Dictionary<K,V> { | |
guard let right = right else { return left } |