Skip to content

Instantly share code, notes, and snippets.

View EvgenyArtemov's full-sized avatar
🎯
Focusing

Evgeny Artemov EvgenyArtemov

🎯
Focusing
View GitHub Profile
@EvgenyArtemov
EvgenyArtemov / compose.js
Created June 30, 2022 07:48 — forked from jperasmus/compose.js
"compose" function that handles both sync and async functions
// Async compose
const compose = (…functions) => input => functions.reduceRight((chain, func) => chain.then(func), Promise.resolve(input));
// Functions fn1, fn2, fn3 can be standard synchronous functions or return a Promise
compose(fn3, fn2, fn1)(input).then(result => console.log(`Do with the ${result} as you please`))
@EvgenyArtemov
EvgenyArtemov / branch-fu.md
Created April 2, 2021 12:25 — forked from unbracketed/branch-fu.md
Moving commits between branches

Example: Moving up to a few commits to another branch

Branch A has commits (X,Y) that also need to be in Branch B. The cherry-pick operations should be done in the same chronological order that the commits appear in Branch A.

cherry-pick does support a range of commits, but if you have merge commits in that range, it gets really complicated

git checkout branch-B
git cherry-pick X
git cherry-pick Y