(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| // Playground - noun: a place where people can play | |
| // I wouldn't want a pair of birds that were... too demonstrative. | |
| func idiot<A>(a : A) -> A { | |
| return a | |
| } | |
| func kestrel<A, B>(a : A) -> B -> A { | |
| return { _ in a } |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #import <Foundation/Foundation.h> | |
| @interface LBRObject : NSObject | |
| @end | |
| @implementation LBRObject | |
| - (void)execute | |
| { | |
| @synchronized(self) { |
I have reluctantly come to accept that it is impossible to create a "perfect" programming language. Every language is domain-specific in some sense, and many of the criteria that make a language good for one purpose are fundamentally in opposition to qualities that are good for another.
A classic example would be "scripting" languages versus "embedded" languages.
Good qualities in a scripting language are:
| """ File: reveal.py | |
| Add to ~/.lldbinit: | |
| command script import ~/.lldb-scripts/reveal.py | |
| Q: Want to automatically load the Reveal lib on launch while debugging from Xcode? | |
| A: In Xcode: | |
| Add a Symbolic Breakpoint | |
| Symbol: "UIApplicationMain" | |
| Action: Debugger Command with value "reveal" |
| @interface DDDelegateProxy : NSProxy | |
| + (id)proxyForDelegate:(id)delegate conformingToProtocol:(Protocol *)protocol; | |
| @property (weak, readonly) id delegate; | |
| @property (strong, readonly) Protocol *protocol; | |
| /*! | |
| * Set a default return value for a method on the delegate's protocol. | |
| * \param value This must be a block that returns the default value. Bad Things will happen if it's not. |
| // Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
| // Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
| // Licensed under MIT (http://opensource.org/licenses/MIT) | |
| // | |
| // You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
| // PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit. | |
| #import <objc/runtime.h> | |
| #import <objc/message.h> |
| /** | |
| * @discussion takes the passed image parameter and displays a view controller modally that shwos the image | |
| * You can call it from the debugger like this: | |
| * expr JSDebugDisplayImage(image) | |
| * @note you can dismiss the view controller simply by tapping on it | |
| */ | |
| extern void JSDebugDisplayImage(UIImage *image); |
Generate the list yourself:
$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./* | \
sed 's/NS_AVAILABLE_IOS(.*)//g' | \
sed 's/NS_DEPRECATED_IOS(.*)//g' | \
sed 's/API_AVAILABLE(.*)//g' | \
sed 's/API_UNAVAILABLE(.*)//g' | \
sed 's/UI_APPEARANCE_SELECTOR//g' | \
| /** | |
| * Several macros simplifying use of weak references to self inside blocks | |
| * which goal is to reduce risk of retain cycles. | |
| * | |
| * Example: | |
| * @code | |
| @interface Example : NSObject{ | |
| int _i; | |
| } |