Skip to content

Instantly share code, notes, and snippets.

View jankowiakdawid's full-sized avatar

Dawid Jankowiak jankowiakdawid

View GitHub Profile
@jankowiakdawid
jankowiakdawid / reduce-performace-comparison.js
Last active May 24, 2021 11:08
Reduce performace comparison
/*
Eample for a blog post https://dawids-journal.vercel.app/journal/008-reduce
*/
console.time('setup');
let usersCount = 10;
// let usersCount = 100;
// let usersCount = 1_000;
@jankowiakdawid
jankowiakdawid / 99bottles.test.ts
Created January 6, 2020 22:51
99 bottles of OOP (TS Deno version)
import {
assertEquals,
runIfMain,
test
} from "https://deno.land/std/testing/mod.ts";
import { strip } from "./utils.ts";
// import { verse, verses, song } from "./sandi99bottles.ts";
import { verse, verses, song } from "./my99bottles.ts";
function *fib () {
let n1 = 1, n2 = 1;
yield n1;
yield n2;
while (true) {
yield n1 + n2;
[n1, n2] = [n2, n1 + n2];
}
}
@jankowiakdawid
jankowiakdawid / Readme.md
Last active August 29, 2015 14:05
Adventures in functional programming in ES6

After watching inspirational talk by Jim Weirich from 2012 schodlandjs on vimeo i came with slightly improved version rewritten with use of ES6 fat arrow syntax (it works in FF so why not).