View MathTools.h
// Maps one range onto another
// Example: [-50, 100] to [0, 1.0]
// Example: [0.2, 1.0] to [1.0, 0.0]
#define MAPRANGE(x, inputLow, inputHigh, outputLow, outputHigh) ({\
__typeof(x) __x = (x); \
__typeof(inputLow) __inputLow = (inputLow); \
__typeof(inputHigh) __inputHigh = (inputHigh); \
__typeof(outputLow) __outputLow = (outputLow); \
__typeof(outputHigh) __outputHigh = (outputHigh); \
(((__x - __inputLow) / (__inputHigh - __inputLow)) * (__outputHigh - __outputLow)) + __outputLow; \
View SharkfoodMuteSwitchDetector.h
//
// SharkfoodMuteSwitchDetector.h
//
// Created by Moshe Gottlieb on 6/2/13.
// Copyright (c) 2013 Sharkfood. All rights reserved.
//
#import <Foundation/Foundation.h>
View SKAction+FadeColorAction.h
//
// SKAction+FadeColorAction.h
//
#import <SpriteKit/SpriteKit.h>
@interface SKAction (FadeColorAction)
+ (SKAction*) fadeColorFrom:(SKColor*)fromColor toColor:(SKColor*)toColor duration:(CGFloat)duration;
View MotionOrientation.h
//
// MotionOrientation.h
//
// Originally based on code by Sangwon Park on 5/3/12.
// Copyright (c) 2012 tastyone@gmail.com. All rights reserved.
// Heavily modified by Ryan McLeod on 10/3/14
// Copyright (c) 2014 ryanmcleod@gmail.com. All rights reserved.
#import <CoreMotion/CoreMotion.h>
#import <CoreGraphics/CoreGraphics.h>
View extraUIActivityTypes.m
// UIActivityTypes
NSString * const UIActivityTypePostToInstagram = @"com.burbn.instagram.shareextension";
NSString * const UIActivityTypeFacebookMessenger = @"com.facebook.Messenger.ShareExtension";
NSString * const UIActivityTypeWhatsApp = @"net.whatsapp.WhatsApp.ShareExtension";
NSString * const UIActivityTypeTelegraph = @"ph.telegra.Telegraph.Share";
NSString * const UIActivityTypeGmail = @"com.google.Gmail.ShareExtension";
NSString * const UIActivityTypeTencent = @"com.tencent.mqq.ShareExtension";
NSString * const UIActivityTypeViber = @"com.viber.app-share-extension";
NSString * const UIActivityTypeTumblr = @"com.tumblr.tumblr.Share-With-Tumblr";
NSString * const UIActivityTypeSkype = @"com.skype.skype.sharingextension";
View CircularTextView.h
//
// CircularTextView.h
// Wormhole
//
// Created by Ryan McLeod on 5/5/15.
// Copyright (c) 2015 Ryan McLeod. All rights reserved.
//
#import <UIKit/UIKit.h>
View CircleBloom.h
//
// CircleBloom.h
// Blackbox
//
// Created by Ryan McLeod on 7/25/16.
// Copyright © 2016 Ryan McLeod. All rights reserved.
//
#import <UIKit/UIKit.h>
View UIBezierPathLength.swift
// The MIT License (MIT)
//
// Copyright (c) 2016 Jansel Valentin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
View README.md

Okay, so the basic idea is markdown but customizable… Often I want a section of text to be bold, but I'm also making a byline with strange kerning, or a strikeout with different opacity, etc. I envision a system for defining markdown codes with coresponding styles per NSAttributableString (this class could be subclassed to persist styles, ala NSProductHeaderString, etc)

So imagine we have a string like: "Hello, well aren't you bold." where we want to bold the last word. With NSAttributedString we either have to hardcode the NSRange or do a substring look-up at run-time to generate a NSRange to apply the bold style, or just append the bold string with its bolding attribute. None are concise or easy to understand and change.

Now imagine we define styles:

NSDictionary *styles = @{
View UIView+Screengrab.h
//
// UIView+Screengrab.h
//
//
// Created by Ryan McLeod on 7/27/15.
//
//
#import <UIKit/UIKit.h>