Skip to content

Instantly share code, notes, and snippets.

View distransient's full-sized avatar
🍜
Mmm noodles tasty

Kel distransient

🍜
Mmm noodles tasty
View GitHub Profile
@spion
spion / 01-fractal-weird-design.md
Last active November 2, 2019 12:27
Node streams - a fractal of weird design

Node streams - a fractal of weird design

and a potential refactor that could fix that

This is a list of issues and confusions I've encountered with node streams, and things I wish were designed and implemented differently. If promise-streams is ever going to change to a design that doesn't build on top of node streams, this would be a list of mistakes to avoid

  1. enc parameter - Why is encoding always passed together with the data? It should be a separate concern. It doesn't even make sense in objectMode
  2. eventemitter base - This encourages a lot of random events to be "attached" by other authors which doesn't work. Best to have an uniform (typed) interface so that everyone knows what to expect.
  3. relying on nextTick etc for execution order - This is very unreliable and causes all sorts of unpredictable rules for implementers which are not documented anywhere. When you attach listeners determines what will happen.
  4. no error propagation - we need the
@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

@quephird
quephird / wavey-thingy.clj
Created August 22, 2014 21:02
This is an attempt at gaining a slightly deeper understanding of the code presented here: http://codegolf.stackexchange.com/questions/35569/tweetable-mathematical-art#35689
(ns fun-with-quil.wavey-thingy
(:use quil.core))
(def screen-w 1024)
(def screen-h screen-w)
(defn make-wave-fn []
"[x1 y1] specifies the epicenter of the waves
[x2 y2] specifies an anti-epicenter of sorts
l controls the length between waves
@tmpvar
tmpvar / offset-minkowski-surface-nets.js
Last active August 29, 2015 14:02
offsetting adventures (run these with beefy!)
var Polygon = require('polygon');
var fc = require('fc');
var Vec2 = require('vec2');
var ndarray = require('ndarray');
var sn = require('surface-nets');
var cwise = require('cwise');
var fill = require('ndarray-fill');
var poly = new Polygon([
@sergejmueller
sergejmueller / ttf2woff2.md
Last active March 9, 2024 13:37
WOFF 2.0 – Learn more about the next generation Web Font Format and convert TTF to WOFF2
@nickbudi
nickbudi / README.md
Last active February 17, 2024 14:25
Budi's Counter-Strike: Global Offensive config

Budi's CS:GO Config

This is my constantly updated CS:GO autoexec config. Changelogs can be found under revisions here

Put autoexec.cfg in ...\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg or take what you want from it and add to your autoexec config!

After the Wild West Simulator 2015 update, video.txt needs to be put in ...\Steam\userdata\<Steam3 ID>\730\local\cfg

Launch Options

@alco
alco / gist:3731366
Created September 16, 2012 07:03 — forked from james4k/gist:3730918
package main
import "fmt"
import "math"
func FastInvSqrt(x float32) float32 {
xhalf := float32(0.5) * x
i := math.Float32bits(x)
i = 0x5f3759df - i>>1
x = math.Float32frombits(i)