Skip to content

Instantly share code, notes, and snippets.

var gestureRecognizers = [AnyObject]()
gestureRecognizers.append(sceneView.gestureRecognizers!)
//add a tap gesture recogizer
let tapGesture = UITapGestureRecognizer(target: self, action: Selector("handleTap"))
gestureRecognizers.append(tapGesture)
sceneView.gestureRecognizers = gestureRecognizers
[
{"make":"ford","year":"1984","worth":0.20},
{"make":"yugo","year":"1904","worth":3.20},
{"make":"chevy","year":"1994","worth":4.20}
]
#flatten a directory structure and get all pngs
find . -type f -name "*png" -print0 | xargs -0 -J% mv % ~/Desktop/export_to_here
@skipallmighty
skipallmighty / startup.sh
Last active August 29, 2015 14:07
startup ubuntu for flask
# sudo sh startup.sh app password example.com
apt-get update
apt-get -y upgrade
apt-get install -y nginx
apt-get install -y postgresql postgresql-contrib
apt-get install -y libpq-dev
apt-get install -y python-pip python-dev build-essential
cat > /etc/nginx/sites-available/default << EOF
@skipallmighty
skipallmighty / runswift
Created September 9, 2014 20:20
Run Swift REPL on new Xcode 6 GM build
xcrun swift -v -sdk $(xcrun --show-sdk-path --sdk iphonesimulator)
class Human {
var name = "Fred"
var eyeColor = "Blue"
func dance() -> String {
return "I'm Dancing, I'm Dancing!"
}
}
var d = ["EWR":"Newark","JFK":"John F Kennedy"]
if let result = d["EWR"] {
result
}
@skipallmighty
skipallmighty / map.swift
Created June 23, 2014 12:23
Map Example
[1,2,3,4,5].map {
(number:Int) -> Int in
return number + 1
}
//This returns [2,3,4,5,6]