Skip to content

Instantly share code, notes, and snippets.

View Slackwise's full-sized avatar
🛸
Proselytizing Parenthesized Programming

Adam Flanczewski Slackwise

🛸
Proselytizing Parenthesized Programming
View GitHub Profile
@Slackwise
Slackwise / rich-already-answered-that.md
Created September 10, 2025 16:33 — forked from reborg/rich-already-answered-that.md
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

@Slackwise
Slackwise / memo.js
Created September 6, 2025 15:04
Simplest memoization function in JavaScript using the latest available syntax.
const memo = f => {
let cache = {};
return (...args) => {
let key = JSON.stringify(args);
return cache[key] ?? (cache[key] = f(...args));
}
}
@Slackwise
Slackwise / gist:51947209915a5bd1647982c2891a21ac
Created October 17, 2024 00:18 — forked from jackrusher/gist:5139396
Hofstadter on Lisp: Atoms and Lists, re-printed in Metamagical Themas.

Hofstadter on Lisp

In the mid-80s, while reading through my roommate's collection of Scientific American back issues, I encountered this introduction to Lisp written by Douglas Hofstadter. I found it very charming at the time, and provide it here (somewhat illegally) for the edification of a new generation of Lispers.

In a testament to the timelessness of Lisp, you can still run all the examples below in emacs if you install these aliases:

(defalias 'plus #'+)
(defalias 'quotient #'/)
(defalias 'times #'*)
(defalias 'difference #'-)
@Slackwise
Slackwise / npm_version_cheatsheet.md
Created September 27, 2024 16:19 — forked from jonlabelle/npm_version_cheatsheet.md
npm version cheatsheet

npm version cheatsheet

npm uses Semantic Versioning

npm uses Semantic Versioning. Given a version number MAJOR.MINOR.PATCH, increment the:

  1. MAJOR version when you make incompatible API changes,
  2. MINOR version when you add functionality in a backwards compatible manner, and
  3. PATCH version when you make backwards compatible bug fixes.
@Slackwise
Slackwise / oledtest.pde
Created July 16, 2024 03:18 — forked from marcedwards/oledtest.pde
OLED black smearing test for Processing 3.4
// OLED black smearing test for Processing 3.4.
// Black smearing = changing pixels to and from pure black is slower than changing to and from other colours.
//
// Code by @marcedwards from @bjango.
void setup() {
size(360, 360, P2D);
frameRate(60);
smooth(8);
noStroke();
@Slackwise
Slackwise / gist:f7594c993d84f8707d30ae49471d765d
Last active June 12, 2023 01:52 — forked from dangerous/gist:98b2b158b5625f837b8bdce43a965b3f
First 10000 reddit users sourced from karmalb
1. kn0thing
2. spez
3. third
4. fifth
5. fourth
6. agentorange
7. chickenlittle
8. erzengel
9. fizzypop
10. madmax2
@Slackwise
Slackwise / compile-less.js
Created March 30, 2023 20:15
NPM script to compile LESS files because the Visual Studio "Web Compiler" extension doesn't work anymore.
import fs from 'fs';
import { exec } from 'child_process';
const compilationConfig = JSON.parse(fs.readFileSync('compilerconfig.json', 'utf8'));
compilationConfig
.filter(fileConfig => fileConfig.inputFile.endsWith('.less'))
.map(({outputFile, inputFile, minify}) => {
try {
console.log("LESS\tInput:\t" + inputFile);
@Slackwise
Slackwise / getByPath.js
Last active July 15, 2025 17:08
Recursively navigates into nested collections inside `collection` by following a sequence of properties `pathArray`, executing any methods along the way, and returning the first `undefined` encountered.
/**
* Recursively navigates into nested collections inside `collection` by
* following a sequence of properties `pathArray`, executing any methods
* along the way, and returning the first `undefined` encountered.
* @param {any} collection - The collection to traverse.
* @param {Array<string|number|function()>} pathArray - A sequence of
* property names, indexes, or functions to traverse into the `collection`.
* @returns {any|undefined} The final value found,
* otherwise the first `undefined` encountered.
* @example
@Slackwise
Slackwise / Fallout76Custom.ini
Created November 1, 2021 17:47
My Fallout 76 config to disable junk like vsync, mouse accel, DOF, etc.
[General]
bGamepadEnable=0
sIntroSequence=0
bSkipSplash=1
bDisableAllGore=0
[Display]
uiOrthoShadowFilter=3
bVolumetricLightingEnable=0
iSize H=1080
iSize W=1920
@Slackwise
Slackwise / advise.js
Last active October 6, 2021 17:59
Example advising function and use.
const advise = (fn, preFn = (...args) => args, postFn = (...args) => args) =>
(...args) =>
postFn(fn(...preFn(...args)));
add = (x, y) =>
x + y;
advisedAdd = advise(
add,