Skip to content

Instantly share code, notes, and snippets.

View angus-c's full-sized avatar

angus croll angus-c

View GitHub Profile
@dmvaldman
dmvaldman / FRPandPhilosophy.md
Last active February 23, 2024 16:24
Descartes, Berkeley and Functional Reactive Programming

Descartes, Berkeley and Functional Reactive Programming

By @dmvaldman

Functional Reactive Programming (FRP) is generating buzz as an alternative to Object Oriented Programming (OOP) for certain use cases. However, an internet search quickly leads a curious and optimistic reader into the rabbit-hole of monads, functors, and other technical jargon. I’ve since emerged from this dark and lonely place with the realization that these words are mere implementation details, and that the core concepts are far more universal. In fact, the groundwork was laid down many centuries before the first computer, and has more to do with interpretations of reality, than structuring programs. Allow me to explain.

There’s an old thought experiment that goes like this:

Tree

@rizalp
rizalp / JavaScript Sieve Of Atkin.js
Created May 3, 2013 11:49
return array of primes below limit using Sieve of Atkin Algorithm http://en.wikipedia.org/wiki/Sieve_of_Atkin #JavaScript #primes
function sieveOfAtkin(limit){
var limitSqrt = Math.sqrt(limit);
var sieve = [];
var n;
//prime start from 2, and 3
sieve[2] = true;
sieve[3] = true;
for (var x = 1; x <= limitSqrt; x++) {
@juandopazo
juandopazo / gist:3718393
Created September 13, 2012 22:59
Why I want ES.next yesterday
// some code I'm writing...
class Matrix {
/* ... */
transpose() {
var [n, m] = this.size(),
rows = this.rows,
result = [],
i = 0, j = 0;