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
# treats your Xcode project file as a binary; prevents Git from trying to fix newlines, show in diffs, and excludes from merges | |
*.pbxproj -crlf -diff -merge |
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
// boolean_variety.h | |
// | |
// Copyright (c) 2013 Derrick Hathaway | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
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 <objc/runtime.h> | |
#define SYNTHESIZE(class, getter, setter) \ | |
static const void *getter##PropertyKey = &getter##PropertyKey;\ | |
- (type *)getter { \ | |
return objc_getAssociatedObject(self, getter##PropertyKey); \ | |
} \ | |
\ | |
- (void)setter:(class *object) { \ | |
objc_setAssociatedObject(self, getter##PropertyKey, object, OBJC_ASSOCIATION_RETAIN);\ |
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 | |
func +<A,B>(lhs: [A:B], rhs: [A:B]) -> [A:B] { | |
var dict : [A:B] = [:] | |
for (key, value) in lhs { | |
dict[key] = value | |
} | |
for (key, value) in rhs { | |
dict[key] = value |
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
// | |
// NSManagedObjectContext+Project.swift | |
// | |
// Created by Derrick Hathaway on 2/22/15. | |
// Copyright (c) 2015 The Best Bits LLC. | |
// | |
// Permission is hereby granted, free of charge, to any person | |
// obtaining a copy of this software and associated documentation | |
// files (the "Software"), to deal in the Software without | |
// restriction, including without limitation the rights to use, |
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
Process: carthage [25835] | |
Path: /usr/local/bin/carthage | |
Identifier: carthage | |
Version: 0 | |
Code Type: X86-64 (Native) | |
Parent Process: bash [21316] | |
Responsible: Terminal [21310] | |
User ID: 1745180192 | |
Date/Time: 2015-05-26 10:54:31.718 -0600 |
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
protocol Thing { | |
func foo() | |
} | |
extension Thing { | |
func foo() { | |
print("just a thing") | |
} | |
} |
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
func format(date: Date) -> String { ... } | |
let dueDate = Date? | |
print(""" | |
Assignment | |
-- | |
due: \(dueDate.map(format(date:)) ?? "none") | |
""" |
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 React from 'react'; | |
import { Orientation } from 'react-native-device-orientation'; | |
// Orientation.addSubscriber(callback: (orientation: 'portrait' | 'landscape') => {}) | |
// Orientation.removeSubscriber(callback) | |
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
type RouteLeaf = string | number | bigint | boolean | null | undefined | |
// there's probably a tidier way to get around TS's lack of support for recursive `type`'s | |
type RouteBranch<SubBranch = RouteLeaf> = Record<string | number | symbol, RouteLeaf | SubBranch> | |
type RouteComponent = | |
| RouteLeaf | |
| RouteBranch<RouteBranch> | |
| RouteBranch<RouteBranch<RouteBranch>> | |
| RouteBranch<RouteBranch<RouteBranch<RouteBranch>>> | |
| RouteBranch<RouteBranch<RouteBranch<RouteBranch<RouteBranch>>>> |
OlderNewer