Skip to content

Instantly share code, notes, and snippets.

View hirasso's full-sized avatar
👋

Rasso Hilber hirasso

👋
View GitHub Profile
@hirasso
hirasso / acf-oembed-cache.php
Last active February 29, 2024 12:27
Cache oEmbed responses in WordPress when using Advanced Custom Fields
<?php
/**
* Plugin Name: ACF oEmbed Cache
* Description: Cache ALL ACF oEmbed responses, no matter in what context
* Version: 1.0.0
* Requires PHP: 8.0
* Author: Rasso Hilber
* Author URI: https://rassohilber.com/
*/
@hirasso
hirasso / ForceLowercaseURLs.php
Last active January 18, 2024 20:36
WordPress: Force Lowercase URLs
<?php
/**
* Plugin Name: Force Lowercase URLs
* Description: Redirect uppercase URLs to their lowercase counterpart.
* Version: 1.0.0
* Requires PHP: 8.0
* Author: Rasso Hilber
* Author URI: http://rassohilber.com/
*/
@hirasso
hirasso / lqip.ts
Last active October 19, 2023 10:14
Render low quality image placeholders using BlurHash or ThumbHash base46 strings (TypeScript)
import { decodeBlurHash } from 'fast-blurhash';
import { thumbHashToRGBA } from 'thumbhash';
/**
* Render low quality image placeholders using ThumbHash
*
* thumbHashToRGBA() expects a Unit8Array. What we have is a base64 representation,
* so we first need to convert that so that thumbHashToRGBA can actually consume it
* @see https://github.com/evanw/thumbhash/issues/18#issuecomment-1484243562
*/
@hirasso
hirasso / ACFSyncFieldGroups.php
Last active April 17, 2024 15:09
A WordPress Plugin that allows to sync ACF field groups via WP CLI
<?php
/*
* Plugin Name: ACFSyncFieldGroups
* Plugin URI: https://gist.github.com/hirasso/c48c04def92f839f6264349a1be773b3
* Description: Allows to sync ACF field groups via WP CLI
* Version: 0.0.2
* Author: Rasso Hilber
* Author URI: https://rassohilber.com/
* License: GPL2+
* License URI: https://www.gnu.org/licenses/gpl-2.0.txt
@hirasso
hirasso / WpscHtaccessHelper.php
Last active December 16, 2022 10:01
A WordPress plugin to modify the .htaccess file generated by WP Super Cache
<?php
/*
* Plugin Name: WP Super Cache Htaccess Helper
* Plugin URI: https://gist.github.com/hirasso/254c5ca2f7464d7b65d3905524bb755d
* Description: Modifies WP Super Caches .htaccess file.
* Version: 0.0.1
* Author: Rasso Hilber
* Author URI: https://rassohilber.com/
* License: GPL2+
* License URI: https://www.gnu.org/licenses/gpl-2.0.txt