Skip to content

Instantly share code, notes, and snippets.

@strarsis
strarsis / service-workers.md
Created February 11, 2025 22:08 — forked from Rich-Harris/service-workers.md
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@choco-bot
choco-bot / 1.RegistrySnapshot.xml
Created February 11, 2025 22:08
texstudio.install v4.8.6 - Passed - Package Tests Results
<?xml version="1.0" encoding="utf-8"?>
<registrySnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<user>S-1-5-21-3145728412-1752322905-909997274-1000</user>
<keys>
<key installerType="Custom" displayName="TeXstudio - TeXstudio is a fully featured LaTeX editor." displayVersion="4.8.6">
<RegistryView>Registry64</RegistryView>
<KeyPath>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\TeXstudio</KeyPath>
<DefaultValue />
<InstallLocation><![CDATA["C:\Program Files\texstudio"]]></InstallLocation>
<UninstallString><![CDATA["C:\Program Files\texstudio\uninstall.exe" /S]]></UninstallString>
@HugsLibRecordKeeper
HugsLibRecordKeeper / output_log.txt
Created February 11, 2025 22:07
Rimworld output log published using HugsLib
Log uploaded on Tuesday, February 11, 2025, 5:07:49 PM
Loaded mods:
Harmony(brrainz.harmony)[mv:2.3.1.0]: 0Harmony(2.3.3), HarmonyMod(2.3.1)
Core(Ludeon.RimWorld): (no assemblies)
Royalty(Ludeon.RimWorld.Royalty): (no assemblies)
Ideology(Ludeon.RimWorld.Ideology): (no assemblies)
Biotech(Ludeon.RimWorld.Biotech): (no assemblies)
HugsLib(UnlimitedHugs.HugsLib)[ov:11.0.4]: 0Harmony(av:2.3.3,fv:1.2.0.1), HugsLib(av:1.0.0,fv:11.0.4)
Allow Tool(UnlimitedHugs.AllowTool): AllowTool(av:3.6.0,fv:3.13.1)
Graphics Settings+(Telefonmast.GraphicsSettings)[mv:1.0.0]: GraphicSetter(1.0.0)
@EthanH234
EthanH234 / index.html
Created February 11, 2025 22:06
Media Queries
<h1>Media Queries</h1>
<h2>Subheading</h2>
<div class="flex-row">
<div class="image-container">
<img src="https://picsum.photos/900/600" alt="">
</div>
<div class="image-container">
<img src="https://picsum.photos/900/600" alt="">
</div>
@HugsLibRecordKeeper
HugsLibRecordKeeper / output_log.txt
Created February 11, 2025 22:05
Rimworld output log published using HugsLib
Log uploaded on Tuesday, February 11, 2025, 10:05:56 PM
Loaded mods:
Harmony(brrainz.harmony)[mv:2.3.1.0]: 0Harmony(2.3.3), HarmonyMod(2.3.1)
Core(Ludeon.RimWorld): (no assemblies)
Royalty(Ludeon.RimWorld.Royalty): (no assemblies)
Ideology(Ludeon.RimWorld.Ideology): (no assemblies)
Biotech(Ludeon.RimWorld.Biotech): (no assemblies)
HugsLib(UnlimitedHugs.HugsLib)[ov:11.0.4]: 0Harmony(av:2.3.3,fv:1.2.0.1), HugsLib(av:1.0.0,fv:11.0.4)
Research Reinvented: Stepping Stones(PeteTimesSix.ResearchReinvented.SteppingStones): ResearchReinvented_SteppingStones(1.0.0)
Tribal Essentials Reborn(zal.tribalessentials)[mv:1.2.3.0]: (no assemblies)
@choco-bot
choco-bot / Install.txt
Created February 11, 2025 22:05
pssuspend v1.07 - Failed - Package Tests Results
2025-02-11 22:05:32,933 5000 [DEBUG] - XmlConfiguration is now operational
2025-02-11 22:05:33,053 5000 [DEBUG] - Adding new type 'CygwinService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2025-02-11 22:05:33,074 5000 [DEBUG] - Adding new type 'CygwinService' for type 'IInstallSourceRunner' from assembly 'choco'
2025-02-11 22:05:33,074 5000 [DEBUG] - Adding new type 'PythonService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2025-02-11 22:05:33,074 5000 [DEBUG] - Adding new type 'PythonService' for type 'IListSourceRunner' from assembly 'choco'
2025-02-11 22:05:33,088 5000 [DEBUG] - Adding new type 'PythonService' for type 'IInstallSourceRunner' from assembly 'choco'
2025-02-11 22:05:33,108 5000 [DEBUG] - Adding new type 'PythonService' for type 'IUninstallSourceRunner' from assembly 'choco'
2025-02-11 22:05:33,108 5000 [DEBUG] - Adding new type 'RubyGemsService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2025-02-11 22:05:33,108 5000 [DEBUG] - Adding new typ
@choco-bot
choco-bot / FilesSnapshot.xml
Created February 11, 2025 22:05
vscode v1.97.1 - Passed - Package Tests Results
<?xml version="1.0" encoding="utf-8"?>
<fileSnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<files>
<file path="C:\ProgramData\chocolatey\lib\vscode\vscode.nupkg" checksum="F37B0F129E96D46F25B9A5D4F3E41DC0" />
<file path="C:\ProgramData\chocolatey\lib\vscode\vscode.nuspec" checksum="69FB0252A1B2198C9E8C1C04AD5C4CCE" />
</files>
</fileSnapshot>
[Fact]
public void Divide_ShouldThrowException_WhenDividingAnyNumberByZero()
{
// Act
var result = () => _calculator.Divide(1, 0);
// Assert - FluentAssertions
result.Should().Throw<DivideByZeroException>()
.WithMessage("Cannot divide by zero.");
@shopper-myles
shopper-myles / example.tsx
Created February 11, 2025 22:05
Example of instrumentation
import {onCLS, onTTFB} from 'web-vitals';
const entryTypes = [
'navigation',
'visibility-state',
'measure',
'long-animation-frame',
'resource',
'paint',
] as const;
@gardient
gardient / unattended-upgrades-repos.py
Created February 11, 2025 22:05
a python script to get the repos you are missing from unattended upgrades
import os, re, pdb, distro
from pprint import pprint
## Get the repos
PATH = "/var/lib/apt/lists/"
files = os.listdir(PATH)
release_files = [file for file in files if file.endswith("Release")]
ORIGIN_PATTERN = re.compile("Origin: (.*)\n")
SUITE_PATTERN = re.compile("Suite: (.*)\n")