Skip to content

Instantly share code, notes, and snippets.

View spicecadet's full-sized avatar

Edmund Turbin spicecadet

View GitHub Profile
@spicecadet
spicecadet / backup.sh
Created October 7, 2015 16:47
This is a quick bash script I built to handle db export and docroot backup for my local vagrant box. Potentially useful if you are using a Vagrant box that does not backup files and db on Vagrant Destroy. Note that you'll need to add your password to run the copy command on line 31.
#! /bin/bash
# create variables for directories
main_backup_dir=$HOME/Development/backups
vagrant_dir=$HOME/Development/hgv/hgv_data
vagrant_root_dir=$HOME/Development/hgv
today="$(date +'%m-%d-%Y')"_daily_backup
daily_backup_dir=$HOME/Development/backup/$today
# print directories to screen for testing
echo ----------: Main backup dir: $main_backup_dir
@spicecadet
spicecadet / Gulpfile.js Example
Last active October 8, 2015 08:29
This is an example gulp workflow that I run locally which handles sass compiling, image optimization, minification and reloading.
// gulp plugins
var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var livereload = require('gulp-livereload');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var minify = require('gulp-minify-css');
var imageop = require('gulp-image-optimization');
var livereload = require('gulp-livereload');

Keybase proof

I hereby claim:

  • I am spicecadet on github.
  • I am spicecadet (https://keybase.io/spicecadet) on keybase.
  • I have a public key ASCC52FurGf2ViwJgzlK_AgtWUv73GE9xni_rser_gHULgo

To claim this, I am signing this object:

@spicecadet
spicecadet / gist:71d65fab0480812bc66b09b69d056253
Created November 17, 2018 10:10
WP-CLI Get Production DB
#!/bin/bash
#get siteurl option from prod and dev
PROD_SITEURL=$(wp @prod option get siteurl);
DEV_SITEURL=$(wp @dev option get siteurl);
#Export database from prod and import to dev
wp @prod db export - > prod.sql
wp @dev db import /srv/www/edmund/prod.sql
@spicecadet
spicecadet / 1. Codeship Deployment
Last active October 5, 2020 21:40
This is my deployment script for pushing from Github to a WP Engine WordPress install. The scripts below can be added as custom scripts to Codeship's Deployment Pipelines.
# Environment Variables
#INSTALL=
#EMAIL=
#ENVIRONMENT="production"
#SERVICE=
#ASSERTIBLE_CODE=
@spicecadet
spicecadet / composer.json
Created September 1, 2015 14:00
Here's the composer file used in my demo during my talk at WordCamp Norrkoping
{
"name": "edmund.turbin/wordpress-starter",
"description": "This is a basic wordpress install with some changes to the wp-content and core file locations",
"type": "dev",
"license": "GPL",
"authors": [
{
"name": "Edmund Turbin",
"email": "edmund.turbin@wpengine.com"
}