Skip to content

Instantly share code, notes, and snippets.

View gtkatakura's full-sized avatar

gtkatakura

View GitHub Profile
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') {
@gtkatakura
gtkatakura / introrx.md
Created July 5, 2016 00:49 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
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));