Skip to content

Instantly share code, notes, and snippets.


Drew Douglass DrewDouglass

View GitHub Profile
DrewDouglass / steps.txt
Created May 20, 2016
Cleaning a hacked WordPress website.
View steps.txt
Cleaning a (typical) Hacked Site
- Create backup of site
- Deactivate any unnecessary plugins. Delete any plugins and themes that are not in use.
- Update all plugins and WordPress through WP admin. We'll replace everything later, but this allows any database updates to happen.
- Download
- Download fresh copies of every plugin.
- If ACF 4.x installed, upload ACF 5.x and go through database updates (if multi-site, have to go through each site as of now). Then delete ACF 4.x and add-on plugins.
- Review wp-config.php to make sure there is no malicious code. If not confident, install fresh copy of wp-config.php with correct database information.
- Deactivate site by commenting out database info in wp-config.php
- Delete all files and folders in root directory except wp-config.php and wp-content/, and possibly any non-WP folders such as emails.
DrewDouglass /
Last active Jun 9, 2020
Rsync from remote to local with custom ssh port
# Simple with recursion and info/progress
rsync -havzP --stats remote@host:/your/path ~/Desktop/your/folder
#Custom Port
rsync -chavzP --stats -e "ssh -p 1999" remote@host:/path/to/files ~/Desktop/local/folder
DrewDouglass / bootstrap-menu-hover.css
Created May 3, 2016
Show bootstrap dropdown menus on hover instead of click.
View bootstrap-menu-hover.css
.sidebar-nav {
padding: 9px 0;
.dropdown-menu .sub-menu {
left: 100%;
position: absolute;
top: 0;
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 / 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 / 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