Skip to content

Instantly share code, notes, and snippets.

View logicmason's full-sized avatar

Mark Wilbur logicmason

View GitHub Profile
@clumma
clumma / BetterParts.md
Last active February 26, 2017 04:24
JavaScript: The Better Parts
@logicmason
logicmason / yc.js
Last active June 18, 2021 01:46
Y combinator in JavaScript and factorial function example (recursion with all anonymous functions)
var Y = function(proc) {
return (function(x) {
return proc(function(y) { return (x(x))(y);});
})(function(x) {
return proc(function(y) { return (x(x))(y);});
});
};
var factgen = function(fact) {
return function(n) {
@angelikatyborska
angelikatyborska / .zshrc
Last active May 30, 2022 09:35
Prevent yourself from using the wrong js package manager
npm() {
if [ -f yarn.lock ]; then
echo 'use yarn';
else
command npm $*;
fi
}
yarn() {
if [ -f package-lock.json ]; then