Skip to content

Instantly share code, notes, and snippets.

// This script exports illustrator layers as individual PNGs.
//
// author: Nathan Sweet
// author: Ivan Gadzhega
// rev: 10
const L2PNG_NAMESPACE = "http://esotericsoftware.com/l2png";
const L2PNG_PREFIX = "l2png:";
const IGNORE_HIDDEN_LAYERS_ID = "ignoreHiddenLayers";
@brentsimmons
brentsimmons / gist:5810992
Last active January 3, 2021 02:22
Detect a tap on a URL inside a UITextView. Note: the rs_links method isn't included -- you'll need something that takes text and returns an array of detected links. This gist just demonstrates walking through the UITextView characters.
@implementation UITextView (RSExtras)
static BOOL stringCharacterIsAllowedAsPartOfLink(NSString *s) {
/*[s length] is assumed to be 0 or 1. s may be nil.
Totally not a strict check.*/
if (s == nil || [s length] < 1)
return NO;
@spenrose
spenrose / gist:4539571
Last active December 11, 2015 03:39
Logging macros
// Logging Macros
#ifdef DEBUG
# define DLog(FORMAT, ...) printf("%s %s ~ %s\n", [[[NSDate date] description] UTF8String], __PRETTY_FUNCTION__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String])
#else
# define DLog(...)
#endif
// ALog always displays output regardless of the DEBUG setting
#define ALog(FORMAT, ...) printf("%s %s ~ %s\n", [[[NSDate date] description] UTF8String], __PRETTY_FUNCTION__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String])
@alloy
alloy / Instructions.md
Created June 28, 2012 12:56
Run iOS unit tests (in a Xcode workspace) when a file changes and *only* those tests related to the changed file. Also trims otest output and colors test results.