This file contains hidden or 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
| 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 |
This file contains hidden or 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
| [ | |
| {"make":"ford","year":"1984","worth":0.20}, | |
| {"make":"yugo","year":"1904","worth":3.20}, | |
| {"make":"chevy","year":"1994","worth":4.20} | |
| ] |
This file contains hidden or 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
| #flatten a directory structure and get all pngs | |
| find . -type f -name "*png" -print0 | xargs -0 -J% mv % ~/Desktop/export_to_here |
This file contains hidden or 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
| # 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 |
This file contains hidden or 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
| xcrun swift -v -sdk $(xcrun --show-sdk-path --sdk iphonesimulator) |
This file contains hidden or 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
| class Human { | |
| var name = "Fred" | |
| var eyeColor = "Blue" | |
| func dance() -> String { | |
| return "I'm Dancing, I'm Dancing!" | |
| } | |
| } |
This file contains hidden or 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
| var d = ["EWR":"Newark","JFK":"John F Kennedy"] | |
| if let result = d["EWR"] { | |
| result | |
| } |
This file contains hidden or 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
| [1,2,3,4,5].map { | |
| (number:Int) -> Int in | |
| return number + 1 | |
| } | |
| //This returns [2,3,4,5,6] |