Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
nolanlawson / .gitignore
Last active March 9, 2024 18:53
Repro an issue with Vitest and crypto.subtle.digest
node_modules
@nolanlawson
nolanlawson / .gitignore
Created January 28, 2024 17:25
Repro multi-page leak in Chromium 121
node_modules
*.heapsnapshot
@nolanlawson
nolanlawson / .gitignore
Created December 10, 2023 18:03
Svelte createRoot with reused props issue (Svelte v4)
bundle.js
bundle.js.map
node_modules
@nolanlawson
nolanlawson / .gitignore
Last active December 10, 2023 18:03
Svelte createRoot with reused props issue (Svelte v5)
bundle.js
bundle.js.map
node_modules
@nolanlawson
nolanlawson / .gitignore
Last active February 20, 2024 17:41
rollup-plugin-svelte v5 emitCss issue
node_modules
@nolanlawson
nolanlawson / test-finalization-registry.html
Last active March 2, 2023 16:17
Test FinalizationRegistry
<!doctype html>
<html>
<button id="derefKey">Deref key</button>
<button id="derefValue">Deref value</button>
<script type=module>
const reg = new FinalizationRegistry(held => {
console.log('gced', held)
})
const map = new WeakMap()
@nolanlawson
nolanlawson / .gitignore
Last active February 9, 2023 16:46
Run Puppeteer and get userAgentSpecificMemory
node_modules
@nolanlawson
nolanlawson / index.html
Created December 15, 2022 19:34
:host pseudo with selector list
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>:host pseudo with selector list</title>
</head>
<body>
<x-cmp class="foo"></x-cmp>
<script>
customElements.define('x-cmp', class extends HTMLElement {
@nolanlawson
nolanlawson / .gitignore
Created November 11, 2022 15:38
Test empty connectedCallback perf
node_modules
@nolanlawson
nolanlawson / scaling_mastodon_down.md
Last active July 23, 2023 06:34
Scaling Mastodon down

Scaling Mastodon down

There is already a guide on scaling your Mastodon server up. This is a short guide on scaling your Mastodon server down.

I.e., maybe you want to run a small instance of <100 active users, and you want to keep your cloud costs reasonable. So you might be running everything on a single machine, with limited memory and CPU. (In my case, I was using a t3.medium instance with 2 vCPUs and 4GB of RAM.) How do you do this?

Note that I'm not a Ruby or Sidekiq expert, and most of this stuff I figured out through trial and error.