Skip to content

Instantly share code, notes, and snippets.

View liautaud's full-sized avatar
🍵

Romain Liautaud liautaud

🍵
View GitHub Profile
@liautaud
liautaud / tailwind-plugin-patcher.py
Last active July 29, 2024 10:33
Small Python script to patch the IntelliJ TailwindCSS plugin.
import re
from zipfile import ZipFile, Path
"""
TailwindCSS plugin patcher for IntelliJ IDEA
--------------------------------------------
1. Download the latest ZIP of the plugin compatible with your version of IntelliJ here:
https://plugins.jetbrains.com/plugin/15321-tailwind-css/versions
2. Fill `CLASS_ATTRIBUTES` to specify which XML attributes can contain Tailwind classes.
@liautaud
liautaud / gatsby-node.ts
Last active July 26, 2022 14:28
Simple `InternalPath` code generation for Gatsby
/**
* Generates an [InternalPath] type with all pages known to Gatsby.
*
* Uses the onPreExtractQueries hook as it's the only hook which both runs
* after pages are created and re-runs when `gatsby develop` detects a change.
*/
const EXCLUDED_PATHS = ["/404/", "/404.html", "/dev-404-page/"];
export const onPreExtractQueries: GatsbyNode["onPreExtractQueries"] = async (
args,