Skip to content

Instantly share code, notes, and snippets.

View gerrgg's full-sized avatar
💯

Greg Bastianelli gerrgg

💯
View GitHub Profile
@gerrgg
gerrgg / sqooush-cli.sh
Created June 5, 2021 16:43
// use sqooush CLI to automatically compress and resize images within a folder.
for FILE in *; do squoosh-cli --mozjpeg 50 --resize '{width: 1000, height: 1000}' "$FILE"; done;
const handleHeaderLogic = (() => {
const header = document.querySelector('header');
const sections = document.querySelectorAll('.section');
const whereSectionsStartAndEnd = {}
const headerHeight = 132;
let lastPosition = Math.ceil(window.scrollY);
let ticking = false;
// scrolls to section when menu item is clicked
const handleClickOnMenuItems = (() => {
@gerrgg
gerrgg / rsync
Created June 1, 2020 14:37
How to copy uploads from remote server to local directory for wordpress.
rsync -v -a -e 'ssh -p 2200' user@example.com:home/wp-content/uploads/ uploads/
// Keep in mind that rsync works left to right (from => target).
// -v verbose lets you know things are happening
// -a archive maintains preserves directory structure
// -e executes a piece of code ( I use it to target a specific port for ssh ).