If you like the assurance that Python's with statement provides, but can't figure out how to properly apply it to individual cursor objects, here's how to do that: import sqlite3 from contextlib import closing con = sqlite3.connect('example.db') with con, closing(con.cursor()) as cur: cur.execute(…)
Mandates ARE laws…
I've seen some people online saying variations on “[COVID-19 quarantine] mandates aren't laws! know your rights! [state] legislature didn't sign off on this!” However, these people are usually incorrect. I'll be compiling examples in this post, more to come if I feel like it, starting out with representative examples from each quadrant of the U.S.: AL Code § 22-2-2 (6) [archived] CA HSC § 120130 (c) and (d), and …
Basic JS Async Cookbook
function asleep(delay) { return new Promise(resolve => setTimeout(resolve, delay)); } // Usage: await asleep(1000); function aalert(message) { return new Promise( resolve => resolve(alert(message)) ); } function aconfirm(message) { return new Promise( resolve => resolve(confirm(message)) ); } function aprompt(message, deflt) { return new Promise( resolve => resolve(prompt(message, deflt)) ); } // Usage: await aalert("The task will begin as soon as you press OK.") ; do_task(); aalert("The task will begin as …
Minecraft: switching from Forge to Fabric
The only amenities I needed were increased FPS, NBT Tooltips, Fancy-leaves-on-Fast-graphics, Zoom, and Saturation Display. These are provided on Fabric, respectively, by: Sodium NBT Tooltip Also Sodium (once they fix #233) Cull Leaves, for now WI Zoom AppleSkin I will update this post as I use more stuff. I will cross out, but not delete, mods I no longer use.
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 …
[BREAKING] Huntsville PD program mandates landlords to deny housing based on criminal history
Both the official website for the Program and its inaugural press release give no indication of these requirements — which the ACLU has argued violate the FHA — and which have entirely evaded public knowledge until now.
test post: dash conversion
[TODO: delete this post once coffee2code/wpuntexturize#2 is resolved]
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: