With the power of await, this isn't so difficult: let nacl, scrypt; function main() { /* Synchronous code that calls nacl and scrypt */ } (async () => { [nacl, scrypt] = await Promise.all([new Promise(nacl_factory.instantiate), new Promise(scrypt_module_factory)]); return main(); })();
Auto-updating userscripts hosted on Github Gist
In the process of crafting this small set of improvements to Advance Wars By Web, I found out about the proper URL for auto-updating userscripts which are hosted on Microsoft's "Gist" service: // @updateURL https://gist.githubusercontent.com/������/����������������/raw/�����.user.js This will always redirect to the latest version of the file.
Javascript: Parsing query parameters
There are at least 2×5×7×3×3×1=630 different things you might unambiguously mean by "parsing" a query string in Javascript: …
WordPress: Restrict MathJax to a class
I write on a variety of topics, only some of which it's appropriate to have mathematical typesetting for. To avoid triggering a math rendering engine on unrelated use of $purious dollar sign$, while activating it when $\text{necessary}\wedge\text{appropriate}$, I decided to restrict them to only <… lang="x-mathjax">. Here's how that's done (for v3): MathJax = { tex: { inlineMath: [ ['$', '$'] ] }, startup: { elements: [':lang("x-mathjax")'] } }; …
ESXi: auto-reboot after Purple Screen of Death
Shamelessly stolen / archived from / hat-tip to this other website, vSkilled, for their post on this. I'm just copying the important details here for when they go under or get consumed by advertisements. esxcfg-advcfg -s 120 /Misc/BlueScreenTimeout # (That's for a two-minute wait; adjust to taste)
Getting OpenNIC to work with pfSense
If you're using an alternate DNS root server such as OpenNIC, and your network uses a pfSense-based router, you may find that clients are, strangely, unable to resolve unofficial TLDs, getting SERVFAIL or NXDOMAIN. There are 3 ways I can think of to quickly solve this problem for the whole network, listed here in increasing order of complication: 1. Disable the DNS resolver Go to Services > DNS Resolver …
Quick setup: Fail2ban on CentOS 8
Instant, easy setup. Just 4 commands, and your server will be protected: dnf install epel-release dnf install fail2ban nano /etc/fail2ban/jail.local Paste this: [sshd] enabled = true Save and quit systemctl enable –now fail2ban To check if it's working: fail2ban-client status sshd
Minecraft: Opening a Java sever to console and mobile clients
It’s now possible, on a a Minecraft Java Edition server, to have simultaneous crossplay among the whole cornucopia of PC, Android, iOS, Win10, Fire/Stick, Switch, PS4, and Xbox One clients!
[WIP] Namecheap let's encrypt
First, go to cPanel's SSL/TLS, Private Keys, View. Note the ID of your TLS key; copy it to your clipboard or something. (Be careful not to grab any extraneous spaces or anything; triple-clicking to select the whole line did work for me, but just be sure you're paying attention.) Then, go to cPanel's Terminal and execute the following commands: mkdir -p ~/virtualenv /opt/alt/python37/bin/python3 -m venv ~/virtualenv/simp_le bash . ~/virtualenv/simp_le/bin/activate …
Python: "with epoll"
If you're using Python 3.4+, select.epoll
already supports context — you're clear to just write with epoll() as E: …
and everything will be OK. If not, here's how to shim it: