This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import imagemin from 'imagemin'; | |
import imageminAvif from 'imagemin-avif'; | |
import imageminSvgo from 'imagemin-svgo'; | |
import imageminMozjpeg from 'imagemin-mozjpeg'; | |
import { promises as fsPromises } from 'node:fs'; | |
import { promisify } from 'node:util'; | |
import path from 'node:path'; | |
import fs from 'graceful-fs'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if pdftk is installed | |
if ! command -v pdftk &> /dev/null; then | |
echo "pdftk is not installed." | |
echo "Please install pdftk for your operating system." | |
echo "" | |
case "$(uname -s)" in | |
Linux*) | |
echo "To install on Ubuntu/Debian, run: sudo apt-get install pdftk" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "pig pink", | |
"color": "#e78ea5" | |
}, | |
{ | |
"name": "deep lilac", | |
"color": "#966ebd" | |
}, | |
{ |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Minifying images stored into ./assets/source-images saving them into the ./assets/dist | |
* | |
* Add to package.json: | |
* "imagemin": "^8.0.1", | |
* "imagemin-mozjpeg": "^10.0.0", | |
* "imagemin-svgo": "^10.0.1", | |
* "imagemin-webp": "^7.0.0", | |
* "graceful-fs": "^4.2.10" | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', '1'); | |
ini_set('display_startup_errors', '1'); | |
error_reporting(E_ALL); | |
const MINIMUM_CHUNK_HEADER_LENGTH = 18; | |
const VP8X_ALPHA = 16; | |
const VP8X_ANIM = 2; | |
const VP8X_EXIF = 8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function oembed_utils( $html ) { | |
// set the default youtube url to youtube-nocookie.com | |
$html = str_replace("www.youtube.com/embed","www.youtube-nocookie.com/embed", $html); | |
// remove youtube random related videos | |
$html = str_replace( "feature=oembed", "feature=oembed&rel=0", $html ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Erik Codekraft - 2022 | |
*/ | |
/// Output the value for the property | |
/// @param {number or string} $val - the base value | |
/// @param {number} $val2 - the value to sum | |
/// @output the result or the css string calc(val1 + val2) | |
@function set_value($val, $val2) { | |
@if (type-of($val) == string) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function webp_uploads_filter_image_copy( $image_meta, $attachment_id ) { | |
$file = wp_get_original_image_path( $attachment_id ); | |
$image_mime = wp_getimagesize( $file )['mime']; | |
if ( 'image/jpeg' === $image_mime ) { |