Skip to content

Instantly share code, notes, and snippets.

Avatar

Joshua Canfield jcanfield

View GitHub Profile
@jcanfield
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 = "https://raw.githubusercontent.com/#{github_username}/#{github_repo}/#{github_branch}"
# Server Configuration
@jcanfield
jcanfield / shrink-git-repo.rb
Created Oct 11, 2014
Optimize and Shrink your GIT Repository (Ruby Script). From Jeff Smith @ rallydev.com.
View shrink-git-repo.rb
#!/usr/bin/env ruby
# Original Scripting by Jeff Smith at http://rallydev.com/, https://www.rallydev.com/community/engineering/shrinking-git-repository-move-githubcom.
module ShrinkIt
BUCKETS = 4
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
<?php
/**
* Listing_Image is a sample class for demonstrating the PDO::FETCH_CLASS method, like a boss.
*
* Example usage:
*<code>
* $img = $q->fetch(PDO::FETCH_CLASS, "Listing_Image");
* echo $img->get_image_tag();
*</code>
@jcanfield
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);
View osx-10.10-setup.md

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
jcanfield / osx-10.10-setup.md
Last active Aug 29, 2015 — forked from kevinelliott/osx-10.10-setup.md
Josh's Blank Canvas for an OSX Reinstall based upon the work of kevinelliott/osx-10.10-setup.md. (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.)
View osx-10.10-setup.md

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">
<head>
<meta charset="UTF-8">
<title><?php echo $post->title; ?></title>
<link rel="stylesheet" href="https://www.drmcdougall.com/wp/wp-admin/load-styles.php?c=1&amp;dir=ltr&amp;load=dashicons,wp-admin,buttons,wp-auth-check&amp;ver=4.1" type="text/css" media="all">
</head>
<body>
<div class="wrap">
@jcanfield
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 :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64-2"
# The url from where the 'config.vm.box' box will be fetched if it
@jcanfield
jcanfield / rmr.sh
Created Apr 1, 2015
Linux command line script to remove recursively (Link with `sudo ln -sv $HOME/.bin/rmr.sh /usr/local/sbin`)
View rmr.sh
#!/bin/bash
# USAGE: rmr *.ra*
# SYNOPSIS: Use this script to remove file types recursively. You can link it via `sudo ln -sv $HOME/.bin/rmr.sh /usr/local/sbin`
echo "--> Removing $1 recursively from $PWD"
find . -name "$1" -print0 | xargs -0 rm -rvf
exit
View semantic-markup-example-html5.html
<!DOCTYPE html>
<html lang="en">
<head>
<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>
<![endif]-->
You can’t perform that action at this time.