Skip to content

Instantly share code, notes, and snippets.

View chrisschreiner's full-sized avatar

Chris Schreiner chrisschreiner

  • Schpaencoder
  • Oslo, Norway, Europe
View GitHub Profile
import Foundation
public typealias GistID = Int
public typealias Result = Int
public typealias ConfigDict = [String:String]
public class GistWriter { // when you create the instance it will be invalid
private var activeGist: GistID?

What is this?

Short text about what this is all about.

System contents

AppDelegate
@ statusBar (awakeFromNib)

ViewController
commit c644eb99cc42d1608a40a1ccd50b8c15afe059b6
Author: Chris Schreiner <schpaencoder@gmail.com>
Date: Sat Jul 18 19:43:31 2015 +0200
> This is how things are now:
> #gss = GameController.stateMachineController.stateMachineDict
#gs = GameController.stateMachineController
* DummyView2.identity(set) -> gss[identity] = StateMachine() -> DummyView2.someAction = gs -> DONE
export PS1="\u@\h/\\W: "
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
import Foundation
import XCPlayground
enum E:ErrorType {
case SomeThingHappened(payload:String)
}
let filename = XCPSharedDataDirectoryPath.stringByAppendingPathComponent("output.plist")
func run(filename:String) throws -> String {
import Foundation
extension String {
func toDouble() -> Double? {
return NSNumberFormatter().numberFromString(self)?.doubleValue
}
}
public struct Place: Printable {
var name: String!
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))
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) {
@chrisschreiner
chrisschreiner / SceneStateMachine.swift
Last active August 29, 2015 14:14
SceneStateMachine V0.2
//
// SceneStateMachine.swift
// Troup
//
// Created by Chris Patrick Schreiner on 04.02.15.
//
//
import Foundation
import SpriteKit