node -p -e "require('./package.json').version"
The -p
argument prints the result and the -e
argument expects executable JS to follow it.
<アンダブロッブ />
node -p -e "require('./package.json').version"
The -p
argument prints the result and the -e
argument expects executable JS to follow it.
When both Node and Lodash are installed, they can be executed in shell scripts:
CHEESE="Camembert of Goat"
CAMEL_CHEESE=$(node -p -e "require('lodash').camelCase('${CHEESE}')")
KEBAB_CHEESE=$(node -p -e "require('lodash').kebabCase('${CHEESE}')")
echo $CAMEL_CHEESE # camembertOfGoat
echo $KEBAB_CHEESE # camembert-of-goat
⚠️ This article is written for Mac OS.
It’s nice to see where the thing your looking at is located in the filesystem.
Continue reading “Full Path”⚠️ This article is written for Mac OS.
When Chrome introduced Tag Groups, it was a big organizing aid. I found there were a couple things missing to make it really productive: keyboard shortcuts.
Continue reading “Chrome Tabs Keyboard Shortcuts”The RULIAD may be defined as the entangled limit of everything that is computationally possible.
During a typical day, I would change to the main branch, pull the latest from the remote, delete the merged branches. Over and over all day, every day of the work. Now instead of all that checkout and pulling, I made a Git JERK!
Continue reading “Git Jerk”Git provides a helpful argument to prefer one branch or the other to “clobber” merge conflicts:
git merge main -Xours
git merge main -Xtheirs
I always get confused what the “X” means. I always assume “X” means mark which branch to clobber. Like “X” out their
branch. Or “X” out our
branch. Please wipe this mnemonic from your brain!
“X” means “PREFER”
“PREFER” the changes in their
branch (-Xtheirs
) or “PREFER” the changes in our
branch (-Xours
).
Jeez!
If you hand over the management of your civilization to machines, you then lose the incentive to understand it yourself or to teach the next generation. […] Up until now, we put a lot of our civilization into books. But the books can’t run it for us. So we always have to teach the next generation. If you work it out, it’s about a trillion person years of teaching and learning in an unbroken chain that goes back tens of thousands of generations. What happens if that chain breaks?
Stuart J. Russell
(async () => {
await new Promise(resolve => setTimeout(resolve, 500));
...
})();
Found on SO.
There must be a reason this is a bad idea or it would be included in the API, right? 😅
URLSearchParams.prototype.toObject = function() {
return […this.keys()]
.reduce((o,k) => ({ …o, [k]: this.get(k) }), {});
}