Skip to content

Instantly share code, notes, and snippets.

View kazmasaurus's full-sized avatar

Zak Remer kazmasaurus

View GitHub Profile
kazmasaurus /
Last active February 23, 2017 18:04 — forked from maciekish/
Reset Xcode. Clean, clear module cache, Derived Data and Xcode Caches. You can thank me later.
# Assumes you're in the directory with the `.xcodeproj`
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/*
rm -rf *.xcodeproj/xcuserdata/
kazmasaurus / GenericRSSFolder.swift
Last active August 29, 2015 14:25
Potential solution to Brent's problem
//: Playground - noun: a place where people can play
import Cocoa
protocol Feed {
var url: String {get}
protocol Folder {
typealias FeedType
kazmasaurus / Closure.swift
Last active August 29, 2015 14:10
Closure chaining.
func foo(completion: ((String) -> Void)?) {
foo { println($0) } // prints "Heyo"
foo(nil) // doesn't crash
kazmasaurus / gist:2dd138f1dcd744d8683a
Last active August 29, 2015 14:02
Lazy property with awkward ternary syntax that I love anyways.
@interface ClassWithLazyProperty ()
@property (nonatomic) LazyPropertyType *lazyProperty;
@implementation ClassWithLazyProperty
- (LazyPropertyType *)lazyProperty
return _lazyProperty ?: (_lazyProperty = ({
LazyPropertyType *property = [LazyPropertyType new];
// setup property