Skip to content

Instantly share code, notes, and snippets.

View kshaner's full-sized avatar

Kurtis Shaner kshaner

  • Seattle, WA
  • 07:22 (UTC -07:00)
View GitHub Profile
@bjornjohansen
bjornjohansen / run-wp-cron.sh
Last active September 17, 2023 21:12
Run all due cron events for WordPress with WP-CLI. Works with both single sites and multisite networks.
#!/bin/bash
# Copyright © 2015 Bjørn Johansen
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
WP_PATH="/path/to/wp"
# Check if WP-CLI is available
if ! hash wp 2>/dev/null; then
@MikeNGarrett
MikeNGarrett / chmod-correct-files
Last active November 21, 2016 08:49
Change file permissions to 664, directory permissions to 775
// Run this from the command line.
// h/t: http://superuser.com/questions/91935/how-to-chmod-755-all-directories-but-no-file-recursively#answer-91966
// add read/execute to world, remove write
chmod -R u+rwX,g+rwX,o+rX-w path/
// remove read/write/execute from world
chmod -R u+rwX,g+rwX,o-rwX path/
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/