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 | |
public class Vertex { | |
var key: String? | |
var neighbors: Array<Edge> | |
init() { | |
self.neighbors = Array<Edge>() | |
} | |
} |
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
//Factorial | |
func fact(n: Int) -> Int { | |
if n == 1 { | |
return 1 | |
} else { | |
return n * fact(n-1) | |
} | |
} |
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
#!/usr/bin/env ruby | |
require 'pry' | |
def fac(n) | |
n==0 ? 1 : n * fac(n-1) | |
end | |
def fact(n) | |
if n == 0 | |
1 |
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
git rm $(git ls-files --deleted) |
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
@objc(Note) | |
class Note: NSManagedObject { | |
@NSManaged var content: String | |
@NSManaged var date: NSDate | |
@NSManaged var business: Business | |
@NSManaged var coldcall: ColdCall | |
@NSManaged var contact: Contact | |
} |
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
func buttonTapped(sender: UIButton!) { | |
let scroll : UIScrollView? = findScroller(self.view) | |
let scrollPoint = CGPointMake(0.0, 0.0) | |
println("Button Tapped") | |
if scroll { | |
scroll!.setContentOffset(scrollPoint, animated: true) | |
} | |
} |
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
// Returns first UIScrollView in subviews of view | |
func searchFor(view: UIView) -> UIScrollView? { | |
for v in view.subviews{ | |
let y = v as UIView | |
if v is UIScrollView { | |
return (v as UIScrollView) | |
} | |
} | |
return nil | |
} |
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 | |
protocol TodoDelegate { | |
func sendCompleted(todo: Todo) | |
} | |
class Notifications : TodoDelegate { | |
var message: String? | |
var sent: Bool = false |
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
// Playground - noun: a place where people can play | |
import UIKit | |
class BaseUIDefaults { | |
class var sharedInstance : BaseUIDefaults { | |
struct Static { | |
static let instance : BaseUIDefaults = BaseUIDefaults() | |
} |