Skip to content

Instantly share code, notes, and snippets.

// VoodooPad
//
// Copyright (C) 2004-2018 Primate Labs Inc. All Rights Reserved.
//////////////////////////////////////////////////////////////////////////////
#import "VPQTTabViewController.h"
NSString* const VPItemScheme = @"x-voodoopad-item";
@interface VPItemLoaderDelegate : NSObject <AVAssetResourceLoaderDelegate>
#!/usr/bin/ruby
# Keith Bauer made this.
require 'find'
require 'getoptlong'
EXTS = Regexp.compile('^.*\.(' + %w[
h hh hpp H
c cc cpp cxx C
m mm M
//
// AGEnqueueCoalescedBlock.h
// EnqueuedBlocks
//
// Created by Seth Willits on 2/26/15.
// Copyright (c) 2015 Araelium Group. All rights reserved.
//
#import <Foundation/Foundation.h>
// In a class hierarchy, it's common for superclasses to require that their subclasses
// override certain methods. Unfortunately the compiler is of no help in enforcing
// this, as there is no annotation to produce a warning if a subclass does not.
//
// Call EnforceSubclassesImplement(class, protocol) to register that direct subclasses
// of the given class must implement the required methods of the given protocol.
// At runtime in debug (#define DEBUG 1) builds before main() is called, checking is
// done and will log each missing method implementation and abort() early.
//
// By placing this call in +load of a parent class, no other work ever need be done.
@swillits
swillits / NSDICT.m
Last active May 2, 2023 13:48
Obj-C NSDictionary Literal-like syntax allowing nil values
/*
---------------------------------------------------------------------------------------
Obj-C Literal Dictionary Syntax - Multiple reasons for allowing nil values
Radar 19747372
---------------------------------------------------------------------------------------
The obj-c literal syntax for dictionaries does not allow nils.
@{key : nil}; // Exception (and compiler error)
@swillits
swillits / Probie.mm
Last active September 13, 2015 17:15
//
// Probie.m
// Probie
//
// Created by Seth Willits, Keith Bauer on 11/19/14.
// Copyright (c) 2014 Araelium Group. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
//
// OSXCrashReporterInfo.h
// OSXCrashReporterInfo
//
// Created by Seth Willits on 10/26/14.
// Copyright (c) 2014 Araelium Group. All rights reserved.
//
#import <CoreFoundation/CoreFoundation.h>
@swillits
swillits / NSTableView_Sorting_Animation.m
Last active September 13, 2015 17:14
Animated moving tables view rows while sorting
[itemsTableView beginUpdates];
double t = [NSDate timeIntervalSinceReferenceDate];
NSArray * oldArrangement = [[self.itemsArrayController.arrangedObjects copy] autorelease];
NSArray * newArrangement = nil;
NSUInteger count = oldArrangement.count;
// "live" indexes of where final objects are currently.
NSUInteger * liveIndexes = calloc(sizeof(NSUInteger), oldArrangement.count);