Skip to content

Instantly share code, notes, and snippets.

View austinzheng's full-sized avatar

Austin Zheng austinzheng

View GitHub Profile
@ryancumley
ryancumley / gist:d376c680e89a7a145a59
Created December 19, 2014 19:00
Class in closure delegate pattern for UIAlertView
/*
Idea for this comes from https://gist.github.com/austinzheng/8fda3f61e1fd06383928#file-main-swift-L19
In an iOS 7.x supporting app which can't use UIAlertController, rather than fork execution paths based on iOS version, we could wire up an old fashioned UIAlertView this way. Still feels more 'block' based and clean to handle, since all the UIAlertViewDelegate stuff is contained within the 'nested-class-in-closure'.
*/
class SampleViewController: UIViewController {
var askTheUserSomethingAlert: UIAlertView
var strongAlertDelegate: UIAlertViewDelegate?

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@john2x
john2x / 00_destructuring.md
Last active April 23, 2024 13:18
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@lattner
lattner / TaskConcurrencyManifesto.md
Last active May 5, 2024 22:32
Swift Concurrency Manifesto