Skip to content

Instantly share code, notes, and snippets.

View alexgleason's full-sized avatar

Alex Gleason alexgleason

View GitHub Profile
@alexgleason
alexgleason / trackpoint.sh
Created March 30, 2018 23:56
Set Thinkpad trackpoint speed/sensitivity
#!/bin/bash
if [ $# -ne 2 ]; then
echo "Usage: trackpoint <sensitivity> <speed>"
echo ""
echo "Sensitivity is the amount of pressure needed to make the cursor reach its max speed. Speed is the max speed."
echo "Note: Both values must be 0-250 with 250 being the most sensitive/fast."
exit 1
fi
@alexgleason
alexgleason / american-policy.ts
Created March 25, 2023 14:43
strfry American Policy (example)
import type { Policy } from 'https://gitlab.com/soapbox-pub/strfry-policies/-/blob/develop/mod.ts';
/** Only American English is allowed. */
const americanPolicy: Policy<void> = (msg) => {
const { content } = msg.event;
const words = [
'armour',
'behaviour',
'colour',
@alexgleason
alexgleason / bench.ts
Created April 24, 2024 18:38
Deno.KV vs lmdb-js benchmark
import lmdb from 'npm:lmdb';
const kv = await Deno.openKv();
const db = lmdb.open({ path: './bench.db' });
await kv.set(['hello'], 'world');
await db.put(['hello'], 'world');
Deno.bench('DenoKv.get', async () => {
await kv.get(['hello']);