Skip to content

Instantly share code, notes, and snippets.

const curry = (fn, ...initialArgs) => (...args) => fn(...initialArgs, ...args);
// const add = (a, b) => a + b;
// const add5 = curry(add, 5);
// const result = add5(1) // 6
// https://programming-idioms.org/idiom/37/currying
@rendall
rendall / .vimrc
Created February 11, 2022 13:08
.vimrc
set hlsearch " highlight all search results
set ignorecase " do case insensitive search
set incsearch " show incremental search results as you type
set number relativenumber " display hybrid relative line numbers
set nobackup
set nowritebackup
set noundofile
set noswapfile " disable swap file
" https://swordandsignals.com/2020/12/13/5-lines-in-vimrc.html
" https://lee-phillips.org/badvim/
@rendall
rendall / three-dice-rolls
Created April 6, 2023 06:20
These are all 216 possible outcomes when rolling 3 dice, with each sum in parenthesis
(3) ⚀ ⚀ ⚀
(4) ⚀ ⚀ ⚁
(4) ⚀ ⚁ ⚀
(4) ⚁ ⚀ ⚀
(5) ⚀ ⚀ ⚂
(5) ⚀ ⚁ ⚁
(5) ⚀ ⚂ ⚀
(5) ⚁ ⚀ ⚁
(5) ⚁ ⚁ ⚀
(5) ⚂ ⚀ ⚀
@rendall
rendall / gist:b91b14144111915cd842713d41a653dd
Created July 6, 2023 09:31
Full Stack Development Course User’s Manual v1
# Full Stack Development Course User’s Manual
Welcome to the Full Stack Development Course! This course is designed to equip you with the knowledge and skills to build comprehensive full stack software projects. You'll learn how to make informed decisions, work effectively in teams, and explore new territories of knowledge. This manual lays out what to expect from the course and how the final score is determined. If anything is unclear, please ask!
# Course Principles
These principles guide class decisions and evaluations.
**Process: **Focus on _how_ decisions are made to improve the decisions themselves.
@rendall
rendall / randomFinnish.ts
Created July 28, 2023 09:26
Randomly Generated Finnish Sentence - Satunnaisesti Generoitu Suomalainen Lause
export const chooseRandomElement = <T>(array: T[]) => array[Math.floor(Math.random() * array.length)]
export const generateRandomFinnishSentence = () => {
type Subject = "minä" | "sinä" | "hän" | "me" | "te" | "he"
const verbAssociationTuples: [string, string[]][] = [
[
"aloittaa",
["opinnot", "projektin", "työt", "harjoituksen", "kokouksen", "urheiluharrastuksen"],
],
@rendall
rendall / randomEnglish.ts
Created July 28, 2023 09:30
Random English Sentence Generator
/*
Output:
You believe a rumor.
She respects rules.
He greets a guest.
He considers a plan.
I count calories.
It considers a proposal.
She kicks a bucket.
*/