Skip to content

Instantly share code, notes, and snippets.

@JohnSundell
JohnSundell / TestingMemoryManagement.swift
Created January 25, 2017 11:15
Sample on how you can easily test your memory management in Swift
class Cache<T> {
private lazy var objects = [String : T]()
func object(forKey key: String) -> T? {
return objects[key]
}
func addObject(_ object: T, forKey key: String) {
objects[key] = object
}
#!/usr/bin/env ruby
# Toine Heuvelmans, November 2016
# A small script that helps you removing Xcode-related data.
# This can potentially save many Gigabytes.
# Just run `ruby xcode_cleanup.rb`.
require 'fileutils'
require 'date'
require 'rubygems'