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
@interface UITableViewDynamicTypeConstantsDelegate : NSObject<UITableViewDataSource> | |
@end | |
@implementation UITableViewDynamicTypeConstantsDelegate | |
- (NSInteger)tableView:(__unused UITableView *)tableView numberOfRowsInSection:(__unused NSInteger)section { | |
return 1; | |
} | |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
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
@implementation UITableViewCell (CellLayoutMargins) | |
+ (UIEdgeInsets)defaultCellLayoutMargins { | |
static NSDictionary *constants; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
NSMutableDictionary *sizeDictionary = [[NSMutableDictionary alloc] init]; | |
// regular sizes | |
sizeDictionary[UIContentSizeCategoryExtraSmall] = [NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(9, 15, 9, 15)]; |
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 is where kids play biatch | |
import CoreData | |
@objc(City) | |
class City: NSManagedObject { | |
@NSManaged var name: String | |
} | |
var cityEntity = NSEntityDescription() |
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 is where kids play | |
import CoreData | |
@objc(City) | |
class City: NSManagedObject { | |
@NSManaged var name: String | |
} | |
var cityEntity = NSEntityDescription() |
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 is where kids play biatch | |
import CoreData | |
@objc(City) | |
class City: NSManagedObject { | |
@NSManaged var name: String | |
@NSManaged var streets: NSSet | |
} |
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
/** | |
* Workaround to prevent VO from accessing elements in presenting view beneath overlay. | |
* | |
* @param transitionView UIPresentationController.containerView | |
*/ | |
static void MLPatchTransitionViewAccessibility(id transitionView) { | |
NSCParameterAssert(transitionView); | |
static Class transitionViewClass; | |
static Class mlTransitionViewClass; |
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
*.strings text diff |
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/sh | |
# | |
# Custom action for Source Tree app to copy commit URL on GitHub | |
# Menu caption: Copy Changeset URL on GitHub | |
# Script to run: ~/bin/github-commit-url | |
# Parameters: $REPO $SHA | |
# | |
if (( $# != 2 )) |
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 | |
//: Binary gap solution for https://codility.com/programmers/task/binary_gap/ | |
import UIKit | |
// use unsigned | |
func binary_gap(_ number: UInt) -> UInt { | |
var max_gap: UInt = 0 | |
var current_gap: UInt = 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
# Put this file in /etc/pf.anchors/ | |
# Options | |
set block-policy drop | |
set fingerprints "/etc/pf.os" | |
set ruleset-optimization basic | |
set skip on lo0 | |
# Interfaces | |
inet_define = "en0" |