💅
“Inside every large program, there is a small program trying to get out.” - C.A.R. Hoare
-
Kroger
- United States
- @grapefinch
Pinned Loading
-
streams.js
streams.js 1function nums(n = 1) {
2return { first: n, rest: () => nums(n + 1) };
3}
45nums().first; // => 1
-
Linked list reverser
Linked list reverser 1function reverseList(input, accumulator) {
2var reversed = {
3id: input.id,
4next: accumulator || null
5};
-
PersistentObject.class.js
PersistentObject.class.js 1export default class PersistentObject {
2constructor(name, contents) {
3this._validateContents(contents);
4this.name = name;
5this.contents = contents;
-
PlantUML skinparams
PlantUML skinparams 1@startuml
2' Basic styles that improve on defaults
3skinparam BackgroundColor Bisque
4skinparam NoteBorderColor DeepSkyBlue
5skinparam ArrowColor Navy
-
Fisher–Yates shuffle
Fisher–Yates shuffle 1// Great explanation https://bost.ocks.org/mike/shuffle/
2// This relies on mutation. Could the algorithm be recreated using immutable data?
3function shuffle(array) {
4var count = array.length
5while (count) {
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.