Skip to content

Instantly share code, notes, and snippets.

View kamvoick's full-sized avatar

Kamil kamvoick

View GitHub Profile
@simme
simme / debounce-throttle.swift
Created December 20, 2016 10:04
Swift 3 debounce & throttle
//
// debounce-throttle.swift
//
// Created by Simon Ljungberg on 19/12/16.
// License: MIT
//
import Foundation
extension TimeInterval {
@maciekish
maciekish / resetXcode.sh
Created August 10, 2016 10:13
Reset Xcode. Clean, clear module cache, Derived Data and Xcode Caches. You can thank me later.
#!/bin/bash
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/*
open /Applications/Xcode.app
@JRGould
JRGould / SharedDataSingleton.swift
Last active April 19, 2017 15:05
Swift shared data singleton with data persistence and simple callback support
/**
Usage: var mySharedData = SharedData.instance
*/
class SharedData {
static let instance: SharedData = {
let instance = SharedData()
// Update instance.defaultsName if desired
if let defaults = NSUserDefaults.standardUserDefaults().objectForKey(instance.defaultsName) as? [String:AnyObject] {
@ZevEisenberg
ZevEisenberg / resetAllSimulators.sh
Last active December 23, 2024 19:57
Reset all iOS simulators with this one weird trick
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
xcrun simctl erase all