Skip to content

Instantly share code, notes, and snippets.


Drew Douglass DrewDouglass

Block or report user

Report or block DrewDouglass

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
DrewDouglass /
Created Sep 13, 2019
Toggle Do Not Disturb Mac OS Command Line
set -eou pipefail
# From and
if [[ $(defaults -currentHost read ~/Library/Preferences/ByHost/ doNotDisturb) -eq 0 ]]; then
DrewDouglass /
Created Jul 11, 2019
Download all files from s3 bucket to local machine
# Can also use --dryrun instead of --recursive to see what would have happened.
aws s3 cp s3://yourbucket/theoneyouwant/ ~/Desktop/bucket-backup --recursive
DrewDouglass /
Created May 6, 2019 — forked from tamouse/
Example: An S3 proxy client written in Python
The server application uses AWS S3 in various places.
This utility provides a common place for interacting
with S3 and handles the authentication in a unified manner.
import os.path
import logging
DrewDouglass / search_custom_columns.php
Created Mar 25, 2019
WordPress Admin area search custom columns
View search_custom_columns.php
function cf_search_join( $join ) {
global $wpdb;
if ( is_search() ) {
$join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';
return $join;
DrewDouglass / getParams.js
Created Dec 5, 2018
jQuery get URL Param
View getParams.js
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL =,
sURLVariables = sPageURL.split('&'),
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
DrewDouglass /
Last active Nov 10, 2018
Find fonts used in PDF file on Mac OS
strings ~/Desktop/filename.pdf | grep FontName
DrewDouglass / workaround-js.html
Last active Jan 30, 2019
Load scripts in webskins that do not load them
View workaround-js.html
<!-- Assumes jQuery is loaded which is almost always the case -->
<img src="/your/image.jpg" alt="Logo" onload="$.getScript('');">
DrewDouglass / scroll.js
Created Nov 8, 2018
Scroll to top - jQuery
View scroll.js
$("a[href='#top']").click(function() {
$("html, body").animate({ scrollTop: 0 }, "slow"); //Can replace with milliseconds
return false;
DrewDouglass / .htaccess
Created Sep 28, 2018
a2 redirect from ahosted subdomain
View .htaccess
RewriteCond %{HTTP_HOST} !$ [NC]
RewriteRule ^(.*)$ https://$1 [R=301,L]
DrewDouglass / target-ie-11.css
Created Sep 12, 2018
Target IE10 and 11 with media query
View target-ie-11.css
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
// IE10+ CSS here
You can’t perform that action at this time.