Skip to content

Instantly share code, notes, and snippets.

View ingadi's full-sized avatar

Axel Ingadi ingadi

View GitHub Profile
@ingadi
ingadi / lazy-list.js
Created May 8, 2024 06:31 — forked from peter-leonov/lazy-list.js
Lazy List, implemented with es6 generators
/* ----------------------------------------- *
Lazy List Implementation
* ----------------------------------------- */
// Haskell-like infinite List, implemented with es6 generators
// Lazyness lets you do crazy stuff like
List.range(0, Infinity)
.drop(1000)
.map(n => -n)
@ingadi
ingadi / asyng-pipe.js
Created July 20, 2023 07:29 — forked from Colour-Full/asyng-pipe.js
Async Fetch Pipe
const fetch = require('node-fetch');
/*
An async pipe, each function we pass to the pipe
will be called with the result from the previous one.
Since this result will be a promise we
will await for the promise to resolve first.
*/
const pipe = (...fns) => x => (
fns.reduce(async (y, f) => f(await y), x)
)
@ingadi
ingadi / gitignore_per_git_branch.md
Created July 13, 2022 12:05 — forked from wizioo/gitignore_per_git_branch.md
HowTo have specific .gitignore for each git branch

How to have specific .gitignore for each git branch

Objective

My objective is to have some production files ignored on specific branches. Git doesn't allow to do it.

Solution

My solution is to make a general .gitignore file and add .gitignore.branch_name files for the branches I want to add specific file exclusion. I'll use post-checkout hook to copy those .gitignore.branch_name in place of .git/info/exclude each time I go to the branch with git checkout branch_name.