Skip to content

Instantly share code, notes, and snippets.

View Stanzilla's full-sized avatar
💭
¯\_(ツ)_/¯

Benjamin Staneck Stanzilla

💭
¯\_(ツ)_/¯
View GitHub Profile
@LeonMueller-OneAndOnly
LeonMueller-OneAndOnly / zustand-zod-storage.ts
Last active January 12, 2025 14:53
Use a zod schema to parse the persisted values of your zustand-store. Otherwise values in zustand's store are never really typesafe
import { PersistStorage } from "zustand/middleware/persist"
import superjson from "superjson"
import { Result } from "@sapphire/result"
import { z } from "zod"
/**
* Design decision: the implementation assumes that the persisted state is a UX benefit,
* not that the persisted data is of immense importance.
* In case we encounter corrupted / non schema conforming fields, we reset the state to the initial values.
*
@pjobson
pjobson / setup_cypress_wsl2.md
Last active May 29, 2025 18:10
Setting Up Cypress on Ubuntu WSL2
@sindresorhus
sindresorhus / esm-package.md
Last active September 3, 2025 19:24
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@sapphyrus
sapphyrus / LICENSE
Last active August 22, 2023 08:44
Fast table deep compare algorithm (Lua)
MIT License
Copyright (c) 2022 sapphyrus
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@seanh
seanh / README.md
Last active November 25, 2023 07:05
Breadcrumbs for GitHub Pages / Jekyll. Pure Liquid (no Jekyll plugin). https://seanh.github.io/posts/2020/01/01/jekyll-breadcrumbs/

Jekyll Breadcrumbs

This is a Jekyll template include that renders navigation breadcrumbs for a page or post. The breadcrumbs include the page or post's collection, categories, date and title. They look something like this:

Home > Posts > 2019 > Dec > 23 > My Blog Post

Installation

@huettern
huettern / renew_ssl_synology.md
Last active June 9, 2025 19:41
Wildcard certificate on Synology NAS

Use certbot to create a wildcard certificat with DNS challenge

DOMAIN="example.com"
sudo certbot certonly  --manual --manual-public-ip-logging-ok --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory -d "*.$DOMAIN"

Follow the instructions on the console and create the DNS TXT record.

Copy the generated files to a working directory

@eveporcello
eveporcello / teacher-settings.json
Last active March 25, 2024 01:55
These are the VSCode settings that we use when recording screencast videos 🍿
{
"zenMode.hideLineNumbers": false,
"workbench.colorTheme": "Night Owl",
"editor.quickSuggestions": {
"other": false,
"comments": false,
"strings": false
},
"editor.wordBasedSuggestions": false,
"editor.suggestOnTriggerCharacters": false,
( function()
{
const darkMode = document.getElementById( 'dark-mode-toggle' );
if( darkMode )
{
const isDarkSchemePreferred = () => window.matchMedia && window.matchMedia( '(prefers-color-scheme: dark)' ).matches;
darkMode.addEventListener( 'click', function( e )
{
@riverar
riverar / features.json
Last active November 8, 2023 20:46
Quick n' dirty hack to enable Your Phone remoting, notification and other experiments
{
"AATes123": true,
"AcrylicAndBackground": true,
"AudioInfoSync": true,
"BatteryIndicator": true,
"CallingDiscoveryTimeout": 30,
"CallingEnableOnARM": true,
"CallingFromMessages": true,
"CallingLabelInProd": true,
"CallingNode": true,
@jsanta
jsanta / index.html
Last active February 12, 2025 13:32
PWA index.html file for Android and iOS copy & paste enabled
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Ionic App</title>
<base href="/" />
<meta
name="viewport"