Skip to content

Instantly share code, notes, and snippets.

View JayHoltslander's full-sized avatar
💭
I may be slow to respond.

Jay Holtslander JayHoltslander

💭
I may be slow to respond.
View GitHub Profile
@JayHoltslander
JayHoltslander / template.html
Created May 9, 2025 18:16
Gravity Forms notification email template. Includes dynamic spam/scam identification helper links
<!-- Email Hack to ensure message preview snippets looks as desired -->
<div style="display: none; max-height: 0px; overflow: hidden;">{Name (First):1.3} filled out the website contact form and wrote: {Message:7}</div><!-- Insert &#847;&zwnj;&nbsp; hack after hidden preview text -->
<div style="display: none; max-height: 0px; overflow: hidden;">
&#847; &zwnj; &nbsp; &#8199; &shy; &#847; &zwnj; &nbsp; &#8199; &shy; &#847; &zwnj; &nbsp; &#8199; &shy; &#847; &zwnj; &nbsp; &#8199; &shy; &#847; &zwnj; &nbsp; &#8199; &shy; &#847; &zwnj; &nbsp; &#8199; &shy; &#847; &zwnj; &nbsp; &#8199; &shy; &#847; &zwnj; &nbsp; &#8199; &shy;
</div>
<!-- /Email Hack -->
<!-- Alert message -->
<aside>
<strong>
@JayHoltslander
JayHoltslander / vlc
Last active May 9, 2025 02:49 — forked from kgriffs/vlc
Run VLC from the command line on Mac OS X and stream internet radio or shuffle local videos fullscreen from a playlist
#!/usr/bin/env bash
/Applications/VLC.app/Contents/MacOS/VLC "$@"
@JayHoltslander
JayHoltslander / functions.php
Last active July 25, 2020 01:20
WP Featured image URLs in JSON REST API
// WP FEATURED IMAGE URLS in JSON API
// See: https://wordpress.stackexchange.com/a/249769/105228
//
add_action( 'rest_api_init', 'add_thumbnail_to_JSON' );
function add_thumbnail_to_JSON() {
//Add featured image
register_rest_field(
'post', // Where to add the field (Here, blog posts. Could be an array)
'featured_image_src', // Name of new field (You can call this anything)
array(
@JayHoltslander
JayHoltslander / convert-all-to-webp.sh
Last active June 9, 2020 19:13
Batch convert images in current folder to webp format using Google's cwebp tool.
# cwebp Docs: https://developers.google.com/speed/webp/docs/using
find ./ -type f -name '*.png' -exec sh -c 'cwebp -q 75 $1 -o "${1%.png}.webp"' _ {} \; &&
find ./ -type f -name '*.jpg' -exec sh -c 'cwebp -q 75 $1 -o "${1%.jpg}.webp"' _ {} \;
@JayHoltslander
JayHoltslander / 11ty-external-json-data.js
Created June 8, 2020 05:42
This file when placed in 11ty's _data folder will fetch a Sheety API endpoint for use with 11ty
// Fetch external data for use with 11ty (https://www.11ty.dev)
const fetch = require("node-fetch");
module.exports = async function() {
console.log( "Fetching titles…" );
// Sheety API - See: https://sheety.co/
const response = await fetch("https://v2-api.sheety.co/fc583ad9266228c03ecc1ee9ace31835/starWarsChronologicalOrder/sheet1")
return response.json();
};
@JayHoltslander
JayHoltslander / Cloudflare's New Deeplinks.md
Last active February 19, 2025 19:53
List of Cloudflare's new dashboard DeepLinks 2020-05-18
@JayHoltslander
JayHoltslander / Broken link checker.md
Last active May 22, 2020 20:58
Broken link checker commands
@JayHoltslander
JayHoltslander / Optimize video for web.md
Last active January 30, 2024 16:04
Optimize video for web ("Hint for Streaming"/"Faststart")

MP4

With: https://www.ffmpeg.org/ (brew install ffmpeg)

The command I used to strip the unused/silent audio channel + "hint for streaming" was:

ffmpeg -i my-video.mp4 -c copy -an -movflags faststart my-video-nosound-hint.mp4

This caused an 8MB video which was too big for web usage, to become a 10MB file that plays immediately while the video is still downloading.

  • Before: Lighthouse complained about the page and the video file (Rightly so).
@JayHoltslander
JayHoltslander / SVG Emoji Favion
Last active April 5, 2020 23:26
SVG Emoji Favicon
<!-- SVG EMOJI FAVICON. See https://twitter.com/LeaVerou/status/1241619866475474946 -->
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22>
<text y=%22.9em%22 font-size=%2290%22>😎</text>
</svg>">
<!--ANIMATED ATTEMPT-->
<!-- SVG EMOJI FAVICON. See https://twitter.com/LeaVerou/status/1241619866475474946 -->
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><style>svg{-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:both;animation-fill-mode:both}svg{-webkit-backface-visibility:visible;backface-visibility:visible;-webkit-animation-name:flip;animation-name:flip}svg{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}@-webkit-keyframes flip{from{-webkit-transform:perspective(400px) rotate3d(0,1,0,-360deg);transform:perspective(400px) rotate3d(0,1,0,-360deg);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}
find ./ -type f -name '*.jpg' -exec sh -c 'cwebp -q 75 $1 -o "${1%.png}.webp"' _ {} \;