Skip to content

Instantly share code, notes, and snippets.

@adrienjoly
adrienjoly / globals.d.ts
Created January 15, 2024 14:49
Typing a `globalThis` variable on Node.js, using TypeScript.
declare global {
// Note: It is crucial to note that [...] variables must only be declared using var
// cf https://copyprogramming.com/howto/using-globalthis-in-typescript
var myGlobalVariable: string;
}
// => `globalThis.myGlobalVariable` is properly typed as `string`
@dsample
dsample / README.md
Last active May 30, 2025 15:41
ASCII art diagrams

ASCI art characters for creating diagrams

Characters:

Single line

  • ASCII code 191 = ┐ ( Box drawing character single line upper right corner )
  • ASCII code 192 = └ ( Box drawing character single line lower left corner )
  • ASCII code 193 = ┴ ( Box drawing character single line horizontal and up )
  • ASCII code 194 = ┬ ( Box drawing character single line horizontal down )
@2E0PGS
2E0PGS / linux-usb-file-copy-fix.md
Last active June 1, 2025 18:41
Fix Ubuntu and other Linux slow/hanging file copying via USB.

If your running a x64 bit Ubuntu or other Linux and find USB transfers hang at the end apply this fix:

echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes
echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes

I suggest you edit your /etc/rc.local file to make this change persistant across reboots.

sudo nano /etc/rc.local