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) }), {});
}
<アンダブロッブ />
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) }), {});
}
[…] no price is too high to pay for the privilege of owning yourself.
Rudyard Kipling
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.
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”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 }
}
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
To write a Chrome extension that allows ES6 imports
, imitate <script type="module">
with a dynamic import:
Chrome extensions exist in an “isolated world” to prevent global var collisions between the website and the extension that runs on a given website. This mostly applies to content_scripts
in an extension.
E.g. window.foo
: my extension declares foo
in the global scope and the website the extension runs on also declares foo
in the global scope. With “isolated world” scoping for the extension, this is not a worry since it doesn’t share scope with the web page it runs on.
Collecting performance metrics, I needed a way to compare optimization before/after numbers into some meaningful value that would impress the brass.
Continue reading “Comparison Formulae”Pika: Have you ever seen a portal?
Kirik: Yes.
Pika: Was it like a doorway or a window?
Kirik: It looks like the room you’re in but the room’s dimensions start changing around you.
Continue reading “Portal”