Skip to content

Instantly share code, notes, and snippets.

View inquisitiveSoft's full-sized avatar

Harry Jordan inquisitiveSoft

View GitHub Profile
@inquisitiveSoft
inquisitiveSoft / UIImage+WithPDF.h
Last active December 31, 2018 13:11
A UIImage category to create images from PDF files, useful for resolution independent UI elements.
// Copyright Harry Jordan, 2012 http://inquisitivesoftware.com/
// Open source under the MIT license http://www.opensource.org/licenses/MIT
#import <UIKit/UIKit.h>
#import <CoreGraphics/CoreGraphics.h>
@interface UIImage (AJKImageWithPDF)
#!/usr/bin/ruby
# MIT License: http://www.opensource.org/licenses/MIT
require 'pathname'
require 'open3'
# read arguments
shouldBuild = FALSE
initialDirectory = Pathname.getwd
# Using a path to differentiate between multiple versions of Xcode
@inquisitiveSoft
inquisitiveSoft / Sift4.swift
Created April 17, 2015 01:50
A translation of Siderite Zackwehdex's Sift4 algorithm for ranking how close one string is to another, which is a few orders of magnitude faster than calculating the Levenshtein distance
//
// Super Fast and Accurate string distance algorithm: Sift4
// http://siderite.blogspot.com/2014/11/super-fast-and-accurate-string-distance.html
//
public func sift4(firstString: String, secondString: String, maxOffset: Int = 5, maxDistance: Int? = nil) -> Int? {
if firstString.isEmpty {
return secondString.isEmpty ? 0 : count(secondString)
} else if secondString.isEmpty {
return count(firstString)