Skip to content

Instantly share code, notes, and snippets.

View tomhermans's full-sized avatar
👻
tinkering

Tom Hermans tomhermans

👻
tinkering
View GitHub Profile
@tomhermans
tomhermans / index.html
Created July 11, 2025 10:14
Typescale Calculator with Clamp (added easy COPY to clipboard)
<div class="wrap">
<aside>
<h1>Typescale Calculator <br> with Clamp
<span>and easy copy to clipboard</span></h1>
<div class="controls">
<div class="control-group">
<label for="baseSize">Base Font Size (rem):</label>
<input type="number" id="baseSize" value="1" step="0.01" min="0.5" max="2">
<script src="https://cdnjs.cloudflare.com/ajax/libs/svelte/4.2.0/svelte.min.js"></script>
<div id="app"></div>
/* Image Resize and Compress Script
* --------------------------------
* This script resizes images in a specified folder and saves them to a new folder with a timestamp. It allows the user to specify the target width, height, and compression quality. The script also handles errors gracefully and provides feedback on the processing status.
*
* Features:
* - Interactive prompts for input folder, dimensions, and compression
* - Preserves aspect ratio (optional)
* - Creates a timestamped output folder
* - Applies JPEG compression with quality control
@tomhermans
tomhermans / index.html
Created March 21, 2025 16:13
miniml placeholder template
<header>
<div>
<p>Tom Hermans</p>
</div>
<div>
<h1>Hi, I'm Tom. <br> I work at the intersection of design and code. </h1>
<img src="https://assets.codepen.io/11287/internal/avatars/users/default.png?fit=crop&format=auto&height=512&version=1738491399&width=512" alt="">
</div>
</header>
<section class="intro">
#!/bin/bash
# Convert all TTF files in the current directory using pyftsubset
# Creates subsetted versions in TTF, WOFF, and WOFF2 formats
# Usage: ./pyftall.sh [format] [options]
# format: ttf (default), woff, woff2, or all
# Any additional options will be passed to pyftsubset
# You can also add any additional parameters for pyftsubset after the format option:
// manifest.json
{
"manifest_version": 3,
"name": "Amazon Price Difference Highlighter",
"version": "1.0",
"description": "Highlights items with significant price differences in Amazon cart",
"permissions": ["activeTab"],
"content_scripts": [
{
"matches": [
// run: node avifconvert.js
const fs = require('fs');
const path = require('path');
const sharp = require('sharp');
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
{
"colors": {
"primary-color": "#ff2222",
"secondary-color": "#77878d"
},
"fonts": {
"primary-font": "chalkduster",
"secondary-font": "Times New Roman, serif"
},
"typesize": {
/**
This Node.js script converts WebP images to either PNG or JPG format.
It's a command-line tool that processes all WebP files in a specified input folder and saves the converted images in a new output folder with a unique timestamp.
more info below:
*/
const fs = require('fs');
const path = require('path');
const sharp = require('sharp');
const readline = require('readline');