(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.
| def fizz_buzz_1(max) | |
| arr = [] | |
| (1..max).each do |n| | |
| if ((n % 3 == 0) && (n % 5 == 0)) | |
| arr << "FizzBuzz" | |
| elsif (n % 3 == 0) | |
| arr << "Fizz" | |
| elsif (n % 5 == 0) | |
| arr << "Buzz" | |
| else |
| gem "actionpack", "~> 4.0.0" |
(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.
| defmodule Optional do | |
| def unit(nil), do: {:err, nil} | |
| def unit(value), do: {:ok, value} | |
| def lift(func) do | |
| fn input -> unit(func.(input)) end | |
| end | |
| def bind({:ok, optional}, functor), do: functor.(optional) | |
| def bind(err, _), do: err |
| /* | |
| Implementation of ISynchronizeInvoke for Unity3D game engine. | |
| Can be used to invoke anything on main Unity thread. | |
| ISynchronizeInvoke is used extensively in .NET forms, it's is elegant and quite useful in Unity as well. | |
| I implemented it so i can use it with System.IO.FileSystemWatcher.SynchronizingObject. | |
| help from: http://www.codeproject.com/Articles/12082/A-DelegateQueue-Class | |
| example usage: https://gist.github.com/aeroson/90bf21be3fdc4829e631 | |
| version: aeroson 2017-07-13 (author yyyy-MM-dd) |