Skip to content

Instantly share code, notes, and snippets.

Michael Behan mbehan

Block or report user

Report or block mbehan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mbehan / ElementaryCellularAutomata.swift
Created Dec 4, 2018
Swift playground for outputting elementary cellular automata
View ElementaryCellularAutomata.swift
import Foundation
extension Bool {
init(_ char: Character) {
self = String(char).boolValue
extension String {
func character(at index: Int) -> Character {
View SwiftyButton.swift
extension UIControl.Event: Hashable{
public var hashValue: Int{
return Int(self.rawValue)
static func == (lhs: UIControl.Event, rhs: UIControl.Event) -> Bool{
return lhs.rawValue == rhs.rawValue

Keybase proof

I hereby claim:

  • I am mbehan on github.
  • I am michaelbehan ( on keybase.
  • I have a public key ASDdJfRf5elbvh7OeiCeKP54WC_DOrPPvDrRsusfFU1iSAo

To claim this, I am signing this object:

mbehan / ForcePanGestureRecognizer.swift
Created Nov 11, 2016
A UIPanGestureRecognizer subclass to get the force of the gesture's touch (assumes a single touch)
View ForcePanGestureRecognizer.swift
import UIKit.UIGestureRecognizerSubclass
class ForcePanGestureRecognizer : UIPanGestureRecognizer {
private(set) var force = CGFloat(0) {
didSet {
if force > maxForce {
maxForce = force
mbehan / ComplicationLaunchSnippets.swift
Created Oct 18, 2016
Sample code demonstrating how to determine which complication family was tapped to launch your watchOS app
View ComplicationLaunchSnippets.swift
// 1.
class ComplicationTimeKeeper{
static let shared = ComplicationTimeKeeper()
var utilitarianLarge : Date?
var utilitarianSmall : Date?
var circularSmall : Date?
var modularLarge : Date?
var modularSmall : Date?
mbehan /
Created Apr 23, 2014
Add as a pre compile build phase in Xcode to auto increment your build number (bundle version). Format is revHash.user.number
last_commit=$(git rev-parse --short HEAD)$([[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]] && echo "*")
CFBundleVersion=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
buildNum=$((buildNum + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $CFBundleVersion" "$INFOPLIST_FILE"
mbehan /
Last active May 19, 2016
Uploads builds produced by Xcode bots
for f in $files
echo Processing $f "..."
productName="$(/usr/libexec/plistbuddy -c Print:ProductName: "$f")"
echo $productName
You can’t perform that action at this time.