Skip to content

Instantly share code, notes, and snippets.

NSAccessibility.h:APPKIT_EXTERN void NSAccessibilityRaiseBadArgumentException(__null_unspecified id element, NSString * __null_unspecified attribute, __null_unspecified id value) NS_DEPRECATED_MAC(10_1, 10_11, "Exceptions are no longer appropriate for indicating errors in accessibility API. Unexpected values should be handled through appropriate type checking.");
NSAlignmentFeedbackFilter.h:NS_CLASS_AVAILABLE(10_11, NA)
NSAttributedString.h:} NS_ENUM_AVAILABLE(10_11, 9_0);
NSAttributedString.h:APPKIT_EXTERN NSString * NSDefaultAttributesDocumentAttribute NS_AVAILABLE(10_11, 7_0); // @"DefaultAttributes", NSDictionary containing attributes to be applied to plain files. Used by reader methods. This key in options can specify the default attributes applied to the entire document contents. The document attributes can contain this key indicating the actual attributes used.
NSAttributedString.h:- (nullable instancetype)initWithURL:(NSURL *)url options:(NSDictionary<NSString *, id> *)options documentAttributes:
@CodaFi
CodaFi / alltheflags.md
Last active June 2, 2024 17:09
Every Option and Flag /swift (1.2) Accepts Ever

#Every Single Option Under The Sun

  • optimization level options
  • automatic crashing options
  • debug info options
  • swift internal options
  • swift debug/development internal options
  • linker-specific options
  • mode options
@CodaFi
CodaFi / T.agda
Created May 26, 2015 22:42
System T, a formulation of Church's Simple Theory of Types in Agda. From ~( http://publish.uwo.ca/~jbell/types.pdf ); Church's paper at ~( https://www.classes.cs.uchicago.edu/archive/2007/spring/32001-1/papers/church-1940.pdf )
{- A straightforward version of Church’s simple type theory is the following system T -}
module T where
open import Data.Nat
-- The type of contexts.
data Γ (X : Set) : Set where
ε : Γ X
_::_ : (γ : Γ X) → X → Γ X
infixl 4 _::_
@CodaFi
CodaFi / NUITouchDevice.h
Created May 1, 2015 00:23
Ever wonder what -[NSTouch device] returns? Well, it looks a hell of a lot like this class.
//
// NUITouchDevice.h
// NUIKit
//
// Created by Robert Widmann on 4/30/15.
// Copyright (c) 2015 CodaFi. All rights reserved.
// Released under the MIT license.
//
#import <Foundation/Foundation.h>
@CodaFi
CodaFi / Nat.swift
Last active January 6, 2024 07:23
An encoding of recursion schemes (à "Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire" [Meijer, Fokkinga, Paterson] ~( http://www.eliza.ch/doc/meijer91functional.pdf )) in Swift.
final class Nat<F> : FunctorOf<F> {
let pred : Optional<F>
override init() {
self.pred = nil
}
init(pred : F) {
self.pred = pred
}
@CodaFi
CodaFi / NUIProtocolChecker.h
Last active July 25, 2017 05:25
A quick reimplementation and port of NSProtocolChecker.
//
// NUIProtocolChecker.h
// NUIKit
//
// Created by Robert Widmann on 1/14/15.
// Copyright (c) 2015 CodaFi. All rights reserved.
// Released under the MIT license.
//
#import <Foundation/Foundation.h>
@CodaFi
CodaFi / NUIDebugObject.h
Created January 15, 2015 02:27
A protocol any Objective-C class can conform to to indicate it supports QuickLooking
//
// NUIDebugObject.h
// NUIKit
//
// Created by Robert Widmann on 2/23/14.
// Copyright (c) 2014 CodaFi. All rights reserved.
// Released under the MIT license.
//
#if ((__clang_major__ >= 5) && (__clang_minor__ >= 1)) || (__clang_major__ > 5)
@CodaFi
CodaFi / NSView+NUIDebugHierarchy.h
Last active April 12, 2016 02:21
Recursively pretty-prints a representation of a view hierarchy.
//
// NSView+NUIDebugHierarchy.h
// NUIKit
//
// Created by Robert Widmann on 1/5/15.
// Copyright (c) 2014 CodaFi. All rights reserved.
// Released under the MIT license.
//
@interface NSView (NUIDebugHierarchy)
//
// Yoneda.swift
// Basis
//
// Created by Robert Widmann on 12/11/14.
// Copyright (c) 2014 Robert Widmann. All rights reserved.
//
import Basis
@CodaFi
CodaFi / Sections.swift
Last active August 29, 2015 14:10
Operator sections for the Swift STL.
/// 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 {