Skip to content

Instantly share code, notes, and snippets.

View jancassio's full-sized avatar
:octocat:
Loading...

Jan Cassio jancassio

:octocat:
Loading...
View GitHub Profile
@Avaq
Avaq / combinators.js
Last active November 5, 2025 22:38
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@gka
gka / make-animated-gifs-using-ffmpeg.md
Last active June 23, 2025 23:20
how to make a nice GIF from png frames

Make sure ffmpeg is up-to-date:

brew update
brew upgrade ffmpeg

Convert a MOV into frames. Tweak the 2/1 if you want more or fewer frames.

@nybblr
nybblr / 1-easy.js
Last active July 13, 2022 03:40
3 examples of using Async Generators and Async Iteration in JavaScript!
// Create a Promise that resolves after ms time
var timer = function(ms) {
return new Promise(resolve => {
setTimeout(resolve, ms);
});
};
// Repeatedly generate a number starting
// from 0 after a random amount of time
var source = async function*() {
@jimmywarting
jimmywarting / readme.md
Last active October 27, 2025 09:52
Cors proxies
Exposed headers
Service SSL status Response Type Allowed methods Allowed headers
@mauriciomassaia
mauriciomassaia / colors.js
Last active September 24, 2019 06:50
Color convertion
/**
* @param {Array} arr - [140, 255, 1]
* @returns {Array} [0.5490196078, 1, 0.003921568627]
*/
export function normalizeArray (arr, value) {
return arr.map(v => v / value)
}
/**
* @param {Number} colorNum 0xff00ff
@malchata
malchata / react-bias.md
Last active May 29, 2021 14:23
React Bias

React Bias

It may seem like a bold suggestion that we as web developers can choose the wrong tools for the job because we tend to be swayed by appeals to popularity or authority, but simple statistics imply just that. For example, React (https://reactjs.org/) is a JavaScript framework that emphasizes componentization and simplified state management. It enjoys strong advocacy from a vocal and dedicated userbase within the developer community.

Despite React’s apparent popularity, however, The HTTP Archive observed in 2020 that React only accounted for 4% of all libraries in use across the 7.56 million origins it analyzed (https://almanac.httparchive.org/en/2020/javascript#libraries).

For context, The State of JS 2020 Survey (https://2020.stateofjs.com/en-US/), which surveyed roughly 23,765 respondents, offers the following statistics:

  • 70.8% of respondents identified as white.
  • 91.1% identified as male, whereas 5.8% identified as female and 0.9% identified as non-binary/third gender.
@mauriciomassaia
mauriciomassaia / squoosh-process-images.js
Last active March 10, 2022 23:00
Using squoosh to optimise and resize images from a source folder to an output folder and keeps the same filename.
const { ImagePool } = require('@squoosh/lib')
const path = require('path')
const fs = require('fs-extra')
const srcFolder = path.join(__dirname, 'big')
const files = fs.readdirSync(srcFolder)
const outputFolder = path.join(__dirname, 'output')
fs.ensureDir(outputFolder)
fs.emptyDirSync(outputFolder)
@phortuin
phortuin / signing-git-commits.md
Last active November 3, 2025 09:37
Set up a GPG key for signing Git commits on MacOS (M1)

Based on this blogpost.

To sign Git commits, you need a gpg key. GPG stands for GNU Privacy Guard and is the de facto implementation of the OpenPGP message format. PGP stands for ‘Pretty Good Privacy’ and is a standard to sign and encrypt messages.

Setting up

Install with Homebrew:

$ brew install gpg