Skip to content

Instantly share code, notes, and snippets.

Rocking this project.

Mike Garrett MikeNGarrett

Rocking this project.
View GitHub Profile
View gist:c8f7087c9dac23281fbdfc40e114b8da
;; Domain:
;; Exported: 2017-01-20 02:47:07
;; This file is intended for use for informational and archival
;; purposes ONLY and MUST be edited before use on a production
;; DNS server. In particular, you must:
;; -- update the SOA record with the correct authoritative name server
;; -- update the SOA record with the contact e-mail address information
;; -- update the NS record(s) with the authoritative name servers for this domain.
MikeNGarrett / change-cpt-to-page.php
Last active Oct 20, 2016
If you need to switch a WordPress custom post type from post capability to page capability, do this.
View change-cpt-to-page.php
/* This doesn't work and here's why not.
* The missing piece here has to do with rewrite rules.
* The registration process creates new rewrite rules during the process.
* This ensures the custom post type is set up appropriately.
* Modifying the url structure (which we're doing here) to hierarchical requires a change to the rewrite rules as well.
* The following is the first change you need to make. The rewrite change is not included here.
MikeNGarrett / wp-cli-install-rec-plugins
Last active Jan 29, 2018
Chained WordPress CLI commands to install and activate recommended plugins.
View wp-cli-install-rec-plugins
# wordpress-seo provides ability to edit meta information and provides sitemap.
# w3-total-cache provides advanced caching no matter the server technology available.
# better-wp-security provides brute force protection and a number of WordPress enhancements.
# google-analytics-for-wordpress provides robust Google Analytics integration through the Google API.
# redirection detects 404s and 301s and allows admins to set up redirects in the WP admin.
# ewww-image-optimizer provides automatic optimization of uploaded images with local libraries instead of cloud-based services.
# backupwordpress simple backup solution that can store backups above web root.
# relevanssi provides better site search using a local index.
# cloudflare is the best. Free automatic CDN and security solution.
# jarvis is a quick search for the WordPress admin. Indespensible.
MikeNGarrett / categories.txt
Created Sep 22, 2016
iOS 10 App Store iMessages Sticker Categories
View categories.txt
Animals & Nature
Comics & Cartoons
Eating & Drinking
Emoji & Expressions
Kids & Family
MikeNGarrett / Contract Killer
Last active Sep 19, 2016 — forked from malarkey/Contract Killer
The latest version of my ‘killer contract’ for web designers and developers
View Contract Killer

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

MikeNGarrett /
Last active Dec 19, 2016
Load Testing Examples
# Siege attempts to recreate real traffic by using a CSV of urls to hit.
# This allows you to remove requests for assets, if you're running a CDN.
# c = concurrent users
# i = "like the internet would visit"
# b = benchmark (no delay needed)
# t = time
# f = file with urls 1 per line
siege -c100 -i -b -t120S -f urls.csv
View gist:3649b4f7a441a7b13ec277e5cf9800c7
View gist:40059cae93fa8311ce5c39caaefb8594
$ # If you're using Drush with MAMP and DevDesktop, you'll have to either change your bash profile or (my preference) specify the path to the correct instance of Drush.
$ # This solves the "Command pm-update needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command" issue.
$ /Applications/DevDesktop/drush/drush
MikeNGarrett /
Created Nov 18, 2015
Go and get the most frequent 404s
grep "HTTP/1.1\" 404" access.log | awk '{print $7 } ' | sort | uniq -c | sort -n
MikeNGarrett / wp-config.php
Last active Nov 25, 2020
All those damned wp-config constants you can never remember.
View wp-config.php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit.
// Database
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users)
// Explicitely setting url
You can’t perform that action at this time.