(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| type style = ReactDOMRe.Style.t; | |
| type element = React.element; | |
| module Breadcrumb = { | |
| [@bs.module "antd"] [@react.component] | |
| external make: | |
| (~ariaLabel: string=?, ~key: string=?, ~style: style=?, ~children: 'b) => | |
| element = | |
| "Breadcrumb"; |
| type Status = "passed" | "failed" | "error" | "unknown"; | |
| interface Things { | |
| a: string; | |
| b: number; | |
| c: { | |
| d: { | |
| e: string; | |
| }; | |
| f: Array<{ g: number }>; |
| const I = x => x | |
| const K = x => y => x | |
| const A = f => x => f (x) | |
| const T = x => f => f (x) | |
| const W = f => x => f (x) (x) | |
| const C = f => y => x => f (x) (y) | |
| const B = f => g => x => f (g (x)) | |
| const S = f => g => x => f (x) (g (x)) | |
| const S_ = f => g => x => f (g (x)) (x) | |
| const S2 = f => g => h => x => f (g (x)) (h (x)) |
| const valueSymbol = Symbol('value'); | |
| class MonetaryAmount { | |
| constructor(value) { | |
| this[valueSymbol] = value; | |
| } | |
| add(amount) { | |
| return new MonetaryAmount(amount.value + this.value); | |
| } | |
| equal(amount) { | |
| return amount.value == this.value; |
| Idea based on this tweet exchange: | |
| coreyhaines: Architecture where ever class is its own gem, communicating via drb. #thoughtleadering #thoughtlendering | |
| coreyhaines: better yet, every method is its won gem, classes are built up by requiring gems that monkey-patch. #truth | |
| josh_cheek: @coreyhaines As each method is a gem, it needs its a namespace, so it's defined in a module… Compose classes by including method's modules. | |
| coreyhaines: @josh_cheek I do like the idea of composing via module inclusions, as well. Interesting. | |
| coreyhaines: Seriously, though, the idea of defining classes via including single-method modules appeals to me. | |
| So, here's my thought for the workshop. It is based a bit on some of the value that I saw doing coderetreats. | |
| title: Super Awesome Happy Fun Coding Workshop, Great Job |
| /* bling.js */ | |
| window.$ = document.querySelector.bind(document); | |
| window.$$ = document.querySelectorAll.bind(document); | |
| Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
| NodeList.prototype.__proto__ = Array.prototype; | |
| NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| These are some features. They can be implemented in any order you prefer. | |
| * an elevator responds to calls containing a source floor and direction | |
| * an elevator delivers passengers to requested floors | |
| * an elevator doesn't respond immediately. consider options to simulate time | |
| * elevator calls are queued not necessarily FIFO | |
| * you may validate passenger floor requests | |
| * you may implement current floor monitor | |
| * you may implement direction arrows | |
| * you may implement doors (opening and closing) |
If you're coming to the Property-Based TDD As If You Meant It Workshop, you will need to bring a laptop with your favourite programming environment, a property-based testing library and, depending on the language, a test framework to run the property-based-tests.
Any other languages or suggestions? Comment below.
.NET (C#, F#, VB)
Python: