(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.
| function identity(value) { | |
| return value; | |
| } | |
| function createArray(length, transformation) { | |
| transformation = transformation || identity; | |
| var arr = []; | |
| while (length != 0) { | |
| arr.push(transformation(arr.length)); |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace ConsoleApplication1 | |
| { | |
| // Version C# to: https://gist.github.com/adomokos/989193 |
| const hackerPowers = { | |
| hackFacebook(userName) { | |
| // something code | |
| return `Olá, Mr ${userName}, meu nome é ${this.name}... e eu fodi a sua timeline ;)`; | |
| }, | |
| }; | |
| const composeWithDelegation = (obj, delegator) => { | |
| for (let [key, value] of Object.entries(delegator)) { | |
| if (typeof value === 'function') { |
(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.
| const atomicArray = require('atomic-array') // [Function] | |
| const randomNumber = require('random-number') // [Function] | |
| const arr1 = atomicArray(10, randomNumber) | |
| const arr2 = atomicArray(10, randomNumber.createEven) | |
| const arr3 = atomicArray(10, randomNumber.createOdd) |
| const Estudo = Class.new do | |
| public static void main(...args: string[]) { | |
| Func<int, int, Number> somar = (x, y) => +$this->soma(new Integer(x), new Integer(y)); | |
| local left, right = args.map(Integer::parseInt); | |
| puts resultado.call(left, right) | |
| } | |
| soma :: Integer -> Integer -> Integer | |
| def soma(n1, n2): |
| EndNo = Class.new { | |
| define_method(:if_example) { |condition| | |
| (condition && ->{ | |
| "yeah, true!" | |
| } || ->{ | |
| "why not?" | |
| }).call | |
| } | |
| define_method(:while_example) { |limit| |
| console.log('Conta'); | |
| class Conta { | |
| constructor() { | |
| this.saldo = 0; | |
| } | |
| deposita(valor) { | |
| this.saldo += valor; | |
| } | |
| } |
| using Emgu.CV; | |
| using Emgu.CV.CvEnum; | |
| using Emgu.CV.Structure; | |
| using Emgu.CV.UI; | |
| using System.Drawing; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; |
| /* | |
| const Y = le => { | |
| const rec = (...args) => le(l)(...args); | |
| return rec; | |
| }; | |
| */ | |
| const Y = le => (f => f(f))(f => le(x => f(f)(x))); | |
| const fibonacci = Y(fib => n => n <= 2 ? 1 : fib(n - 1) + fib(n - 2)); |