Skip to content

Instantly share code, notes, and snippets.


Joshua Canfield jcanfield

View GitHub Profile
jcanfield / Vagrantfile
Created Jul 7, 2014
Vagrant box using Vaprobash. (Creates an Ubuntu latest 64bit machine with Apache2, Ruby, NodeJS, and other options)
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Config Github Settings
github_username = "fideloper"
github_repo = "Vaprobash"
github_branch = "1.0.0"
github_url = "{github_username}/#{github_repo}/#{github_branch}"
# Server Configuration
jcanfield / shrink-git-repo.rb
Created Oct 11, 2014
Optimize and Shrink your GIT Repository (Ruby Script). From Jeff Smith @
View shrink-git-repo.rb
#!/usr/bin/env ruby
# Original Scripting by Jeff Smith at,
module ShrinkIt
def self.remove(files)
files.each_slice(files.size / BUCKETS) do |portion|
paths = portion.join(" ")
ShrinkIt.stream_command("git filter-branch --index-filter 'git rm --cached --ignore-unmatch #{paths}'")
View listing_image.class.php
* Listing_Image is a sample class for demonstrating the PDO::FETCH_CLASS method, like a boss.
* Example usage:
* $img = $q->fetch(PDO::FETCH_CLASS, "Listing_Image");
* echo $img->get_image_tag();
jcanfield / wp-config.php
Created Dec 3, 2014
Wordpress Debugging (enabled via wp-config.php)
View wp-config.php
@ini_set('display_errors', 0);
/* define('WP_DEBUG', false);
define('WP_DEBUG', true);// Turn debugging ON
define('WP_DEBUG_DISPLAY', false);// Turn forced display OFF
define('WP_DEBUG_LOG', true);

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

jcanfield /
Last active Aug 29, 2015 — forked from kevinelliott/
Josh's Blank Canvas for an OSX Reinstall based upon the work of kevinelliott/ (Please note that below the Homebrew Installation I have not modified. There are a few Tools that I use differently. For instance, I am a Sublime Text 3 user, Vagrant and iTerm2 User.)

Mac OS X 10.10 Yosemite

Let's get started. Kevin did a great job on setting up this Gist. My goal is to refine it and retool it to work with my my OSX and Development environments. So here were f*cking go..

Install Software

The software selected is software that is "tried and true" --- software I need after any fresh install. I often install other software not listed here, but is handled in a case-by-case basis.

Install from App Store

View wp-admin-print-template.php
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title><?php echo $post->title; ?></title>
<link rel="stylesheet" href=";dir=ltr&amp;load=dashicons,wp-admin,buttons,wp-auth-check&amp;ver=4.1" type="text/css" media="all">
<div class="wrap">
jcanfield / Vagrantfile
Last active Aug 29, 2015 — forked from bergantine/Vagrantfile
Vagrant configuration offering setup of Ruby, NodeJS, Grunt, Bower and ZURB Foundation. (I put a fork in this!)
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| = "precise64-2"
# The url from where the '' box will be fetched if it
jcanfield /
Created Apr 1, 2015
Linux command line script to remove recursively (Link with `sudo ln -sv $HOME/.bin/ /usr/local/sbin`)
# USAGE: rmr *.ra*
# SYNOPSIS: Use this script to remove file types recursively. You can link it via `sudo ln -sv $HOME/.bin/ /usr/local/sbin`
echo "--> Removing $1 recursively from $PWD"
find . -name "$1" -print0 | xargs -0 rm -rvf
View semantic-markup-example-html5.html
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>Page Title | Site Name</title>
<meta name="description" content="page description">
<link rel="stylesheet" href="style.css">
<!--[if lt IE 9]>
<script src="html5shiv.js"></script>
You can’t perform that action at this time.