This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use this to quickly create a git repo in a Mac Finder folder | |
# | |
# You need to create an Automator service: | |
# - Open Automator, choose to create a new Service | |
# - At the top, select Service receives selected "Folders" in "Finder" | |
# - From the list at the left, choose Library/Utilities, then drag the | |
# Run Shell Script action to the workarea | |
# - Paste the script below into the script area | |
# - Make sure you set the 'Pass input:' selection to "as arguments" | |
# - Save the service with an easy to find name, I used "Git Clone Here" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Python port of alphanumeric derivative of Verhoeff check digit algorithm. | |
Ported from: https://gist.github.com/mwgamera/1088656 | |
""" | |
N = 18 | |
N2 = N * 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Note: This is coded for an XCode Swift playground | |
// | |
import Foundation | |
// | |
// Using the last 15 characters of a FedEx ground "96" barcode, determine the check digit. | |
// | |
// From page 38 of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol Thing { | |
typealias argType | |
func doit(val:argType) -> argType | |
} | |
class IntThing : Thing { | |
func doit(val: Int) -> Int { | |
return val + 1 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Modified for Swift 3 | |
import Cocoa | |
import AppKit | |
import QuartzCore | |
import PlaygroundSupport | |
// Parameters that define the style | |
let hexSideLength: CGFloat = 15.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ported from https://gist.github.com/munificent/b1bcd969063da3e6c298be070a22b604 | |
// | |
// can be run in a Swift playground | |
import Cocoa | |
let HEIGHT = 40 | |
let WIDTH = 80 | |
var FIELD: [[Character]] = Array(repeating: Array(repeating: " ", count: WIDTH), count: HEIGHT) |