Skip to content

Instantly share code, notes, and snippets.

@joemaller
joemaller / compressing-all-images-wordpress.md
Last active June 23, 2023 17:50
How to make sure all images uploaded to WordPress are optimized

Compressing All Uploaded Images with WordPress

A Not Unreasonable Assumption

A lot of WordPress users assume, rightly, that images they've uploaded are compressed and optimized for the web.

This assumption is mostly true, but sometimes poorly-compressed or oversized images will slip through. We can't expect every website user to know the intricasies of image compression, and it's not unreasonable to expect that WordPress should make all uploaded images work correctly.

So let's do that. Here's how to make sure every image uploaded to WordPress is optimized.

@joemaller
joemaller / pager.js
Created August 18, 2019 21:19
Assistive technology pager for NY State Anti-Sexual Harassment Training https://www1.nyc.gov/site/cchr/law/sexual-harassment-training.page
// Paste this into the console
//
// Why? The site is horribly built and it's very easy to lose your progress and be forced to start over.
wait = () => {
setTimeout(() => {
console.log("tap");
if ($("#Text_Entry_Box_2").length) return;
Array.from($("video")).forEach(v => (v.currentTime = v.duration - 0.25));
const sel = [
@richy486
richy486 / youtube_m3u8.txt
Created January 6, 2017 21:16
get youtube streaming url
from: http://stackoverflow.com/a/35631022/667834
$ brew install youtube-dl
$ youtube-dl --list-formats https://www.youtube.com/watch\?v\=[YouTube video id]
shows something like:
....
91 mp4 144p HLS , h264, aac @ 48k
@nrollr
nrollr / ApacheHTTPSConfig.md
Last active March 11, 2024 13:32
Enable SSL in Apache for 'localhost' (OSX, El Capitan)

Enable SSL in Apache (OSX)

The following will guide you through the process of enabling SSL on a Apache webserver

  • The instructions have been verified with OSX El Capitan (10.11.2) running Apache 2.4.16
  • The instructions assume you already have a basic Apache configuration enabled on OSX, if this is not the case feel free to consult Gist: "Enable Apache HTTP server (OSX)"

Apache SSL Configuration

Create a directory within /etc/apache2/ using Terminal.app: sudo mkdir /etc/apache2/ssl
Next, generate two host keys:

@labeneator
labeneator / gist:b5c7ee96192d3e4be61c
Created October 2, 2015 07:17
curling el_capitan || How do grab the pkg from Apple's CDN servers
1. Locate the storedownload process
ps aux |grep storedown
user 494 12.3 0.2 3597016 19724 ?? S 21Sep15 31:14.11 /System/Library/PrivateFrameworks/CommerceKit.framework/Versions/A/Resources/storedownloadd
2. Attach dtruss to the storedownloader process
sudo dtruss -p 494 2>&1 | tee storedownload
3. Start the download on the appstore application
4. Inspect the storedownload process using lsof to figure out the remote endpoints
@jacobsalmela
jacobsalmela / enable-accessibility.sh
Created January 5, 2015 18:54
00.Enable accessiblity
case ${OSTYPE} in
# Snow Leopard through Mountain lion
darwin10*) touch /private/var/db/.AccessibilityAPIEnabled;;
darwin11*) touch /private/var/db/.AccessibilityAPIEnabled;;
darwin12*) touch /private/var/db/.AccessibilityAPIEnabled;;
# Mavericks and Yosemite
darwin13*) sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT INTO access VALUES('kTCCServiceAccessibility','com.apple.systemevents',0,1,1,NULL);";
sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT INTO access VALUES('kTCCServiceAccessibility','com.apple.RemoteDesktopAgent',0,1,1,NULL);";;
darwin14*) sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT INTO access VALUES('kTCCServiceAccessibility','com.apple.systemevents',0,1,1,NULL);";
sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT INTO access VALUES('kTCCServiceAccessibility','com.apple.RemoteDesktopAgent',0,1,1,NULL);";;