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
import XCPlayground | |
import UIKit | |
import Framework3 | |
XCPSetExecutionShouldContinueIndefinitely() | |
var r = request(.GET, "http://en.lichess.org/api/user/peropaal") | |
.response { (request, response, data, error) in | |
println(request) | |
println() |
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
import UIKit | |
import XCPlayground | |
import Framework2 | |
enum PlayerPerspective { | |
case Black, White | |
} | |
class SampleChessBoardView : UIView { | |
var margin: CGFloat = 15 |
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
#!/bin/sh | |
# Some things taken from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' | |
green='\033[0;32m' |
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
//Swift 2.0 | |
import Foundation | |
protocol vcProtocol { | |
func hidePuzzleMessage() | |
func showPuzzleMessage() | |
func prepareBoard() | |
} | |
class ViewController: vcProtocol { |
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
// | |
// SceneStateMachine.swift | |
// Troup | |
// | |
// Created by Chris Patrick Schreiner on 04.02.15. | |
// | |
// | |
import Foundation | |
import SpriteKit |
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
class ST_Initial: ST_Root { | |
var selection = NodeSelection() | |
override var stateName:String {return "Singleselection"} | |
init(context: PStateMachineContext) { | |
super.init(context) | |
} | |
override func perform(f: FunctionEnum) { |
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
public let findCamelCaseStringsRegex = "([A-Z0-9]+(?=$|[A-Z][a-z0-9])|[A-Z]?[a-z0-9]+)" | |
public func find(string:String, regex:String) -> [String] { | |
var r:[String] = [] | |
var sr = string.startIndex..<string.endIndex | |
let opt = NSStringCompareOptions.RegularExpressionSearch | |
while !sr.isEmpty { | |
if let match = string.rangeOfString(regex, options:opt, range:sr) { | |
r.append(string[match]) | |
sr.startIndex = advance(sr.startIndex, distance(match.startIndex,match.endIndex)) |
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
import Foundation | |
extension String { | |
func toDouble() -> Double? { | |
return NSNumberFormatter().numberFromString(self)?.doubleValue | |
} | |
} | |
public struct Place: Printable { | |
var name: String! |
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
import Foundation | |
import XCPlayground | |
enum E:ErrorType { | |
case SomeThingHappened(payload:String) | |
} | |
let filename = XCPSharedDataDirectoryPath.stringByAppendingPathComponent("output.plist") | |
func run(filename:String) throws -> String { |
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
alias emacs="/Applications/Emacs.app/Contents/MacOS/Emacs -nw" | |
alias gist="gist -c -o" | |
alias g="gist -P -o" | |
export sourcecode="/Volumes/Yosemite/Users/chris/Sourcecode/Troup" | |
export CLICOLOR=1 | |
export LSCOLORS="Ehfxcxdxbxegedabagacad" | |
echo "Source code is at $sourcecode" | |
cd $sourcecode | |
alias ls="ls -lG" | |
git log |