Skip to content

Instantly share code, notes, and snippets.

@stevenschobert
stevenschobert / load_remote_content_mail_dot_app.scpt
Last active January 12, 2022 11:19
Apple Script to click the "Load Remote Content" button. I like to disable all remote content in Mail.app, and then bind this script to a keyboard shortcut using Keyboard Maestro. https://www.keyboardmaestro.com
tell application "System Events" to tell process "Mail"
set mainWindow to a reference to the first window
set rootSplitter to a reference to the first splitter group of the mainWindow
set firstSplitter to a reference to the last splitter group of the rootSplitter
set scrollArea to a reference to the last scroll area of the firstSplitter
set scrollGroup to a reference to the first group of the scrollArea
if number of groups of the scrollGroup is greater than 1 then
set maybeRemoteContentGroup to a reference to the first group of the scrollGroup
@LouWii
LouWii / gist:c48bf908a906f7d4da0c
Last active April 10, 2020 06:57
Apache login protection for specific host
### If the server is accessed throught the dev URL example.dev
### User will need to authenticate.
SetEnvIf Host ^example\.dev$ require_auth=true
AuthUserFile /Path/To/.htpasswd
AuthName "Password Protected"
AuthType Basic
# Setup a deny/allow
Order Deny,Allow
@sgr
sgr / workaround_the_iconservices_bug_mavericks.sh
Last active July 25, 2020 11:01
When "com.apple.IconServicesAgent" exhausts CPU resources on Mac OSX mavericks (10.9), you can try following workaround.
#!/bin/sh
mkdir ${TMPDIR}/com.apple.IconServices