Skip to content

Instantly share code, notes, and snippets.

DrewDouglass /
Created Aug 3, 2016
Batch convert JPGs to grayscale with ImageMagick
mkdir bw && for i in *.jpg; do convert $i -colorspace Gray bw/$i; done
DrewDouglass / replacespace.bash
Created Jul 29, 2016
Bash script to replace spaces in filename with underscore.
View replacespace.bash
for f in *\ *; do mv "$f" "${f// /_}"; done
DrewDouglass / Meta Responsive Tag
Created Jul 21, 2016
Because I always forget the syntax.
View Meta Responsive Tag
<meta name="viewport" content="width=device-width, initial-scale=1">
DrewDouglass / flicker-images.js
Last active Jun 9, 2016
Hide/show list of images with jQuery
View flicker-images.js
$.fn.simplestSlideShow = function(settings){
var config = {
'timeOut': 3000,
'speed': 'normal'
if (settings) $.extend(config, settings);
var $elem = $(this);
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 / 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 Dec 21, 2015
Add existing keys to remote server
cat ~/.ssh/ | ssh 'cat - >> ~/.ssh/authorized_keys'
DrewDouglass / bootstrap-custom-menu-breakpoint.css
Last active Dec 16, 2015
Snippet to change breakpoint of hamburger menu without needing to recompile SASS. Tested in bootstrap 3.
View bootstrap-custom-menu-breakpoint.css
@media (max-width: !!!YOUR BREAKPOINT!!!) {
.navbar-header {
float: none;
.navbar-left,.navbar-right {
float: none !important;
.navbar-toggle {
display: block;
DrewDouglass / a.rb
Created Dec 11, 2015
Bootstrap animated hamburger toggle.
View a.rb
.navbar-toggle .icon-bar:nth-of-type(2) {
top: 1px;
.navbar-toggle .icon-bar:nth-of-type(3) {
top: 2px;
.navbar-toggle .icon-bar {
position: relative;
DrewDouglass /
Created Dec 10, 2015
Grab latest WP version, extract, and copy to document root. Gist sent from Command line
wget && tar -xzvf latest.tar.gz && cp -r wordpress/* . && rm -rf wordpress