Skip to content

Instantly share code, notes, and snippets.


Harry Jordan inquisitiveSoft

View GitHub Profile
inquisitiveSoft / Sift4.swift
Created Apr 17, 2015
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
View Sift4.swift
// Super Fast and Accurate string distance algorithm: Sift4
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)
View Open With Xcode.rb
# MIT License:
require 'pathname'
require 'open3'
# read arguments
shouldBuild = FALSE
initialDirectory = Pathname.getwd
# Using a path to differentiate between multiple versions of Xcode
inquisitiveSoft / UIImage+WithPDF.h
Last active Dec 31, 2018
A UIImage category to create images from PDF files, useful for resolution independent UI elements.
View UIImage+WithPDF.h
// Copyright Harry Jordan, 2012
// Open source under the MIT license
#import <UIKit/UIKit.h>
#import <CoreGraphics/CoreGraphics.h>
@interface UIImage (AJKImageWithPDF)