This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
NSString *safe = self.keys.url.port.stringValue; | |
NSString *unsafe = @"url.port.stringValue"; | |
assert([safe isEqualToString:unsafe]); |
// Defines a yet undocumented method to add a warning if super isn't called. | |
#ifndef NS_REQUIRES_SUPER | |
#if __has_attribute(objc_requires_super) | |
#define NS_REQUIRES_SUPER __attribute((objc_requires_super)) | |
#else | |
#define NS_REQUIRES_SUPER | |
#endif | |
#endif | |
@interface UIViewController (SubclassingWarnings) |
; Comments start with semicolons. | |
; Clojure is written in "forms", which are just | |
; lists of things inside parentheses, separated by whitespace. | |
; | |
; The clojure reader assumes that the first thing is a | |
; function or macro to call, and the rest are arguments. | |
; | |
; Here's a function that sets the current namespace: | |
(ns test) |
+ (NSAttributedString *)artsyBodyTextAttributedStringFromHTML:(NSString *)HTML withFont:(UIFont *)font | |
{ | |
NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init]; | |
style.lineHeightMultiple = 1.2; | |
style.paragraphSpacing = font.pointSize * .5; | |
NSDictionary *textParams = @{ | |
NSFontAttributeName : font, | |
NSParagraphStyleAttributeName : style, |
--- Stubs for entity.* callbacks defined in C++. | |
-- | |
-- DO NOT INCLUDE this file in your scripts, it is for documentation purposes only. | |
-- | |
-- Entity callbacks query and mutate the specific entity that is running the | |
-- lua script. They can be called from a _different_ entity using | |
-- world.callScriptedEntity(targetEntityId, "entity.*"), replacing "*" with the | |
-- name of a function defined below. | |
-- | |
-- Specific types of entities (e.g. NPCs, Objects) define different sets of |
// | |
// CollectionViewDataSource.swift | |
// Khan Academy | |
// | |
// Created by Andy Matuschak on 10/14/14. | |
// Copyright (c) 2014 Khan Academy. All rights reserved. | |
// | |
import UIKit |
/// Sectional Sale | |
prefix operator >> {} | |
postfix operator >> {} | |
public prefix func >>(rhs: UInt16) -> UInt16 -> UInt16 { | |
return { lhs in lhs >> rhs } | |
} | |
public postfix func >>(lhs: UInt16) -> UInt16 -> UInt16 { |
struct User { | |
let id: Int | |
let name: String | |
let email: String? | |
} | |
extension User: JSONDecodable { | |
static func create(id: Int, name: String, email: String?) -> User { | |
return User(id: id, name: name, email: email) | |
} |
import Cocoa | |
struct Person { | |
var name: String = "John" | |
var age: Int = 50 | |
var dutch: Bool = false | |
var address: Address? = Address(street: "Market St.") | |
} | |
struct Address { |