Skip to content

Instantly share code, notes, and snippets.

import {
getPluginType,
type PlatePlugin,
type TDescendant,
type TElement,
type TText,
} from '@udecode/plate-common';
import {
remarkTransformElementChildren,
type DeserializeMdPlugin,
@lordelogos
lordelogos / TailwindWithCSSVariables.tsx
Created August 15, 2023 16:06
How to use CSS variables with React-email Tailwind component (@react-email/tailwind)
/**
* To use CSS Variables with the <Tailwind /> component
* You will need to install the package `@mertasan/tailwindcss-variables`
* (and the types for typescript users, `@types/mertasan__tailwindcss-variables` )
*
* yarn add -D @mertasan/tailwindcss-variables @types/mertasan__tailwindcss-variables
*
*/
// Setup your email template with the Tailwind component
@sindresorhus
sindresorhus / esm-package.md
Last active July 11, 2025 12:25
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.

WSL 2 Cisco AnyConnect Networking Workaround

Overview

WSL 2 uses a Hyper-V Virtual Network adapter. Network connectivity works without any issue when a VPN is not in use. However when a Cisco AnyConnect VPN session is established Firewall Rules and Routes are added which breaks connectivity within the WSL 2 VM. This issue is tracked WSL/issues/4277

Below outline steps to automatically configure the Interface metric on VPN connect and update DNS settings (/etc/resolv.conf) on connect/disconnect.

Manual Configuration

Set Interface Metrics

@christophengelmayer
christophengelmayer / tailwind-resonsive-embed.html
Last active September 10, 2024 11:52
Tailwind CSS responsive Video embed
<div class="relative" style="padding-top: 56.25%">
<iframe class="absolute inset-0 w-full h-full" src="https://www.youtube-nocookie.com/embed/FMrtSHAAPhM" frameborder="0" …></iframe>
</div>
@jonnyjava
jonnyjava / working_effectively_with_legacy_code.md
Created November 4, 2019 21:51
Working effectively with legacy code summary

WORKING EFFECTIVELY WITH LEGACY CODE

To me, legacy code is simply code without tests. I’ve gotten some grief for this definition. What do tests have to do with whether code is bad? To me, the answer is straightforward, and it is a point that I elaborate throughout the book: Code without tests is bad code. It doesn’t matter how well written it is; it doesn’t matter how pretty or object-oriented or well-encapsulated it is. With tests, we can change the behavior of our code quickly and verifiably. Without them, we really don’t know if our code is getting better or worse.

Chapter 1 Changing Software

Four Reasons to Change Software: For simplicity’s sake, let’s look at four primary reasons to change software.

@bmaupin
bmaupin / free-database-hosting.md
Last active July 10, 2025 07:21
Free database hosting
@bradtraversy
bradtraversy / webdev_online_resources.md
Last active July 12, 2025 08:08
Online Resources For Web Developers (No Downloading)
@vasanthk
vasanthk / System Design.md
Last active July 12, 2025 23:12
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?