Skip to content

Instantly share code, notes, and snippets.

Joshua Canfield jcanfield

Block or report user

Report or block jcanfield

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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}'")
@shawn-crigger
shawn-crigger / listing_image.class.php
Created Oct 16, 2014
Using PDO::FETCH_CLASS like a Boss, straight object oriented masterbation lol.
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>
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 / 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">
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]-->
@dwabnitz
dwabnitz / revised-font-stack.css
Created Aug 2, 2010 — forked from jonbuda/revised-font-stack.css
A Revised Web Font Stack Selection
View revised-font-stack.css
/*
A Revised Font Stack
from A Way Back
http://www.awayback.com/revised-font-stack/
*/
/*
@thebird
thebird / PrimeEmailSignature.html
Created Nov 15, 2010
The official Prime Studios email signature
View PrimeEmailSignature.html
<table style="border-top-color: #dfdfdf; border-top-width: 1px; border-top-style: solid; width: 100%; margin-top: 10px;" border="0" cellspacing="0" cellpadding="0" align="center">
<tbody>
<tr>
<td align="left" valign="top">
<p style="margin: 0; padding: 0; font-family: Helvetica Neue, Helvetica, Arial, sans-serif; margin-top: 8px; font-weight: bold; color: #333; font-size: 12pt; line-height: 17pt;">Full Name</p>
<p style="margin: 0; padding: 0; font-family: Helvetica Neue, Helvetica, Arial, sans-serif; color: #a0a0a0; font-size: 8pt;">Prime Studios</p>
</td>
<td align="right" valign="top">
<p style="margin: 0; padding: 0; font-family: Helvetica Neue,Helvetica,Arial,sans-serif; margin-top: 8px; font-weight: bold; color: #333; font-size: 12pt; line-height: 17pt;">Phone Number</p>
<p style="margin: 0; padding: 0;"><a style="margin: 0; padding: 0; font-family: Helvetica Neue,Helvetica,Arial,sans-serif; color: #a0a0a0; font-size: 8pt; text-decoration: none;"
@kirkegaard
kirkegaard / sync.js
Created Jul 18, 2011
quick and dirty rsync backup script in node.js
View sync.js
#!/usr/local/bin/node
var sys = require('sys')
, fs = require('fs')
, exec = require('child_process').exec
, colors = require('colors');
var dest = '/Volumes/Drobo/BACKUP/'
, logfile = '.sync/log'
, folders = [
@treybean
treybean / deploy.rb
Created Aug 16, 2011
Heroku Deployment Script
View deploy.rb
#!/usr/bin/env ruby
# Usage
# ./deploy [staging|production] <options>
#
# Options
# -m or --maintenance - Put the application into maintenance mode
# -b or --branch - deploy from a branch other than "master"
if ['staging', 'production'].include? ARGV[0]
You can’t perform that action at this time.