Skip to content

Instantly share code, notes, and snippets.

@philipp-spiess
philipp-spiess / theme-variable-namespaces-table.md
Last active February 4, 2026 18:22
Tailwind theme variable namespaces (v4.1.13)
Namespace Utility classes
--accent-color-* Accent color utilities like accent-blue-600
--animate-* Animation utilities like animate-spin
--aspect-* Aspect ratio utilities like aspect-video
--backdrop-blur-* Backdrop blur utilities like backdrop-blur-md
--backdrop-brightness-* Backdrop brightness utilities like backdrop-brightness-125
--backdrop-contrast-* Backdrop contrast utilities like backdrop-contrast-125
--backdrop-grayscale-* Backdrop grayscale utilities like backdrop-grayscale
--backdrop-hue-rotate-* Backdrop hue rotate utilities like backdrop-hue-rotate-60
@joshnuss
joshnuss / app.js
Last active November 4, 2025 22:39
Express.js role-based permissions middleware
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./authorization"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection
@cod3cow
cod3cow / svg.js
Created June 3, 2015 13:59
Replace all SVG images with inline SVG using jQuery
/*
* Replace all SVG images with inline SVG
*/
jQuery('img.svg').each(function(){
var $img = jQuery(this);
var imgID = $img.attr('id');
var imgClass = $img.attr('class');
var imgURL = $img.attr('src');
jQuery.get(imgURL, function(data) {
@elidickinson
elidickinson / max_width_email.html
Created May 6, 2013 15:10
Email Template trick: max-width with outlook
<!--[if mso]>
<center>
<table><tr><td width="580">
<![endif]-->
<div style="max-width:580px; margin:0 auto;">
<p>This text will be centered and constrained to 580 pixels even on Outlook which does not support max-width CSS</p>
</div>
<!--[if mso]>