Skip to content

Instantly share code, notes, and snippets.

View conorbarclay's full-sized avatar

Conor Barclay conorbarclay

View GitHub Profile
@aaemnnosttv
aaemnnosttv / as3cf-upload-missing-media-library-items-to-s3.php
Last active December 2, 2023 00:40
AS3CF - Upload all missing media library items to S3
<?php
/**
* For use with Amazon S3 and CloudFront by Delicious Brains
*
* Upload this file to your installation and trigger it with WP-CLI:
* wp eval-file as3cf-upload-missing-media-library-items-to-s3.php
*/
global $as3cf;
@julianxhokaxhiu
julianxhokaxhiu / pagespeed_optimize_images.sh
Last active June 15, 2024 17:09
Recursively optimize all PNG and JPG files wherever they are from the script position and inner ( based on OPTING, PNGCRUSH, ADVANCECOMP and JPEGOPTIM )
#!/bin/bash
# Improved as per feedback from @pascal - https://gist.github.com/julianxhokaxhiu/c0a8e813eabf9d6d9873#gistcomment-3086462
find . -type f -iname "*.png" -exec optipng -nb -nc {} \;
find . -type f -iname "*.png" -exec advpng -z4 {} \;
find . -type f -iname "*.png" -exec pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time -ow {} \;
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" \) -exec jpegoptim -f --strip-all {} \;
@inderpreet99
inderpreet99 / install-wpcs.sh
Created August 22, 2017 21:01
install wpcs
brew install php-code-sniffer
composer global require wp-coding-standards/wpcs
phpcs --config-set installed_paths ~/.composer/vendor/wp-coding-standards/wpcs/