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
| def countChange(money: Int, coins: List[Int]): Int = | |
| if (coins.isEmpty || money < 0) | |
| 0 | |
| else if (money == 0) | |
| 1 | |
| else | |
| countChange(money - coins.head, coins) + | |
| countChange(money, coins.tail) |
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
| javascript:var ngStats=function(){var e,t,n,i=0,a=1/0,l=0,o=0,d=1/0,s=0,r=0,c=document.createElement("div");c.id="stats",c.addEventListener("mousedown",function(e){e.preventDefault(),v(++r%252)},!1),c.style.cssText="width:80px;opacity:0.9;cursor:pointer";var p=document.createElement("div");p.id="fps",p.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:%23002",c.appendChild(p);var h=document.createElement("div");h.id="fpsText",h.style.cssText="color:%230ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px",h.innerHTML="W",p.appendChild(h);var m=document.createElement("div");for(m.id="fpsGraph",m.style.cssText="position:relative;width:74px;height:30px;background-color:%230ff",p.appendChild(m);m.children.length<74;){var f=document.createElement("span");f.style.cssText="width:1px;height:30px;float:left;background-color:%23113",m.appendChild(f)}var x=document.createElement("div");x.id="ms",x.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:% |
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
| // A follow-up to the blog post here: | |
| // http://www.scottlogic.com/blog/2014/11/20/swift-initialisation.html | |
| class Foo { } | |
| class Bar: Foo { | |
| // no initial value set here | |
| let myConstant: Int | |
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
| /// An object that has some tear-down logic | |
| public protocol Disposable { | |
| func dispose() | |
| } | |
| /// An event provides a mechanism for raising notifications, together with some | |
| /// associated data. Multiple function handlers can be added, with each being invoked, | |
| /// with the event data, when the event is raised. | |
| public class Event<T> { |
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
| ######################### | |
| # .gitignore file for Xcode4 and Xcode5 Source projects | |
| # | |
| # Apple bugs, waiting for Apple to fix/respond: | |
| # | |
| # 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation? | |
| # | |
| # Version 2.3 | |
| # For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
| # |
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
| // meet Stringy - a simple string type with a fluent interface | |
| struct Stringy { | |
| let content: String | |
| init(_ content: String) { | |
| self.content = content | |
| } | |
| func append(appendage: Stringy) -> Stringy { |
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
| Silverlight and ReactiveExtensions article: | |
| http://blog.scottlogic.com/2010/12/02/exploring-reactive-extensions-rx-through-twitter-and-bing-maps-mashups.html | |
| My Ray Wenderlich author page, contains quite a few ReactiveCocoa and MVVM articles: | |
| http://www.raywenderlich.com/u/ColinEberhardt | |
| ObjC block syntax - say no more! | |
| http://fuckingblocksyntax.com | |
| Twitter app with sentiment analysis |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script> | |
| <script src="http://colineberhardt.github.io/d3fc/Layout.js"></script> | |
| <script src="http://colineberhardt.github.io/d3fc/d3fc.js"></script> | |
| <link href="http://colineberhardt.github.io/d3fc/d3fc.css" rel="stylesheet"/> | |
| <link href="style.css" rel="stylesheet"/> | |
| </head> | |
| <body> |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script> | |
| <script src="http://colineberhardt.github.io/d3fc/Layout.js"></script> | |
| <script src="http://colineberhardt.github.io/d3fc/d3fc.js"></script> | |
| <link href="http://colineberhardt.github.io/d3fc/d3fc.css" rel="stylesheet"/> | |
| <link href="style.css" rel="stylesheet"/> | |
| </head> | |
| <body> |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script> | |
| <script src="http://colineberhardt.github.io/d3fc/Layout.js"></script> | |
| <script src="http://colineberhardt.github.io/d3fc/d3fc.js"></script> | |
| <link href="http://colineberhardt.github.io/d3fc/d3fc.css" rel="stylesheet"/> | |
| <link href="style.css" rel="stylesheet"/> | |
| </head> | |
| <body> |