(subject to additions, but rarely changes)
rule 0: It has to work.
rule 1: As simple as possible.
rule 2: Use the right tool for the job.
rule 3: Everything is a tradeoff. (see Rule 41)
// example courtesy of http://adilatwork.blogspot.com/2012/11/android-dialogfragment-enter-and-exit.html | |
// file location: src/main/java/com/example/ | |
@Override | |
public void onStart() { | |
super.onStart(); | |
// safety check | |
if (getDialog() == null) { | |
return; |
const { | |
network: { | |
match, | |
}, | |
utils: { | |
isOwnedByCurrentPlayer, | |
manhattan, | |
}, | |
} = networkLayer; |
import { Controller } from "stimulus" | |
export default class extends Controller { | |
connect() { | |
const templates = this.element.import.querySelectorAll("template"); | |
templates.forEach(function(template) { | |
document.querySelector('body').appendChild(template); | |
}); | |
} | |
} |
(subject to additions, but rarely changes)
rule 0: It has to work.
rule 1: As simple as possible.
rule 2: Use the right tool for the job.
rule 3: Everything is a tradeoff. (see Rule 41)
import tiktoken | |
import langdetect | |
T = tiktoken.get_encoding("o200k_base") | |
length_dict = {} | |
for i in range(T.n_vocab): | |
try: | |
length_dict[i] = len(T.decode([i])) | |
except: |
Chose between natural mode like MacOS or Windows default mode.
You can do this by going to Start Menu, type PowerShell, and click Run as Administrator.
$mode = Read-host "How do you like your mouse scroll (0 or 1)?"; Get-PnpDevice -Class Mouse -PresentOnly -Status OK | ForEach-Object { "$($_.Name): $($_.DeviceID)"; Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters" -Name FlipFlopWheel -Value $mode; "+--- Value of FlipFlopWheel is set to " + (Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters").FlipFlopWheel + "`n" }
docker-compose exec -T mongodb mongodump --authenticationDatabase admin -u root -p password --db test --archive --gzip > dump.gz |
Ever since I wrote It's Time For Furries to Stop Using Telegram, I've had a few folks ask me about my opinion on Matrix.
(I've also had a few people evangelize Matrix in my mentions. That's annoying.)
My stance on Matrix has been the same for years: I don't trust the Matrix developers to produce a secure protocol, and until they abandon Olm / Megolm in favor of something like MLS, I'm adamant about refusing to trust their team's designs.
To understand why I feel so strongly about this, you need to understand that practically exploitable vulnerabilities were found in Matrix in 2022.
It isn't enough that there were vulnerabilities found to be alarming. Vulnerabilities happen. You aren't writing software if you don't occasionally fuck up.