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 week. Now instead of all that checkout and pulling, I made a Git JERK!
Continue reading “Git Jerk”Git -Xours -Xtheirs arguments
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 or “PREFER” the changes in our branch.
Jeez!
Links
Humans don’t know what they care about
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
Await Timeout
(async () => {
await new Promise(resolve => setTimeout(resolve, 500));
...
})();
Found on SO.
Extend URLSearchParams to object
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) }), {});
}
Pwned
[…] no price is too high to pay for the privilege of owning yourself.
Rudyard Kipling
Git Rollback Alias
Related to the Alias for Git sanity post from a few years back, recently added another to ~/.gitconfig
[alias]
revert-merge = !git revert -m 1 $1
rollback-merge = revert-merge
Where $1
is the commit hash. This only works for rollback of a merge commit on the main branch.
Southern Reach
Where lies the strangling fruit that came from the hand of the sinner I shall bring forth the seeds of the dead…
Continue reading “Southern Reach”Deferred Promise
Found myself in a situation where I wanted to execute a process and then check back on it later to be sure it had completed.
class MyClass {
constructor() {
this.readyPromise = new Promise(
resolve => (this.readyResolve = resolve)
);
}
async executeProcesses() {
await // ...executing processes...
this.readyResolve();
}
ready() { return this.readyPromise }
}
Predator Prayers
People want to give up the responsibility of being able to understand. And because they can’t understand, then they have faith. And they put their faith into people who say they can understand. And I think that’s a situation that’s ripe for a predatory relationship.
Paul Stamets