Skip to content

Instantly share code, notes, and snippets.

Zak kazmasaurus

Block or report user

Report or block kazmasaurus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kazmasaurus
kazmasaurus / resetXcode.sh
Last active Feb 23, 2017 — forked from maciekish/resetXcode.sh
Reset Xcode. Clean, clear module cache, Derived Data and Xcode Caches. You can thank me later.
View resetXcode.sh
#!/bin/bash
# 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/com.apple.dt.Xcode/*
rm -rf *.xcodeproj/xcuserdata/
@kazmasaurus
kazmasaurus / GenericRSSFolder.swift
Last active Aug 29, 2015
Potential solution to Brent's problem
View GenericRSSFolder.swift
//: Playground - noun: a place where people can play
import Cocoa
protocol Feed {
var url: String {get}
}
protocol Folder {
typealias FeedType
@kazmasaurus
kazmasaurus / Closure.swift
Last active Aug 29, 2015
Closure chaining.
View Closure.swift
func foo(completion: ((String) -> Void)?) {
completion?("Heyo!!")
}
foo { println($0) } // prints "Heyo"
foo(nil) // doesn't crash
@kazmasaurus
kazmasaurus / gist:2dd138f1dcd744d8683a
Last active Aug 29, 2015
Lazy property with awkward ternary syntax that I love anyways.
View gist:2dd138f1dcd744d8683a
@interface ClassWithLazyProperty ()
@property (nonatomic) LazyPropertyType *lazyProperty;
@end
@implementation ClassWithLazyProperty
- (LazyPropertyType *)lazyProperty
{
return _lazyProperty ?: (_lazyProperty = ({
LazyPropertyType *property = [LazyPropertyType new];
// setup property
You can’t perform that action at this time.