Skip to content

Instantly share code, notes, and snippets.

View ScottBuchanan's full-sized avatar

Scott Buchanan ScottBuchanan

View GitHub Profile
import Cocoa
struct ImageConstants {
static let gifDelayTime: NSNumber = 2
static let gifLoopCount:NSNumber = 10
}
extension NSImage {
//swift 2.0 translation/adaptation from https://gist.github.com/akisute/1141953
DP(i,j):
soln = i*n array with val inited to -1
return helper(i,j, soln)
helper(i, j, soln):
#first iterate through all the smallest lens, then build on those
for 1 to (j-i) as len:
#make j always len away from i
j = i + len - 1
bestsofar = infin