Skip to content

Instantly share code, notes, and snippets.

View jamiew's full-sized avatar

Jamie Dubs jamiew

View GitHub Profile
require 'fileutils'
# Warning: The following deploy task will completely overwrite whatever is currently deployed to Heroku.
# The deploy branch is rebased onto master, so the push needs to be forced.
desc "Deploy app to Heroku after precompiling assets"
task :deploy do
deploy_branch = 'heroku'
remote = 'heroku'
deploy_repo_dir = "tmp/heroku_deploy"
@jamiew
jamiew / easy-git.rdoc
Created August 13, 2012 04:36 — forked from caseypugh/easy-git.rdoc
GIT MADE EASY

Checkout new repo

git clone git@github.com:vhx/watchlater

go into your vhx folder

cd ~/dev/vhx

Checks current status of modified files

git status

Shows you all the current modifications

@jamiew
jamiew / scratchml.xml
Created January 25, 2012 19:51 — forked from kylemcdonald/scratchml.xml
ScratchML draft spec v5 -- with <time> and <position> as <t> and <p>
<sml>
<!--
# SCRATCH MARKUP LANGUAGE, WORKING DRAFT
http://scratchml.com
* version -- minor versions for small changes, major for incompatibilities
* info -- general file metadata: author info, client info etc.
* turntable - hardware metadata
* mixer -- hardware metadata
@jamiew
jamiew / vhxenq.pl
Created September 20, 2011 02:13 — forked from lcapaldo/vhxenq.pl
Irssi script for automatically queueing video links to VHX.tv // via @elcapaldo on Twitter
use strict;
use Irssi;
use URI::Find::Rule;
use REST::Client;
use URI::Escape;
use vars qw($VERSION %IRSSI);
$VERSION = '0.01';
%IRSSI = (
@jamiew
jamiew / Rakefile
Created September 18, 2011 15:47 — forked from inky/Makefile
Jekyll testing on a budget (rake-flavored)
desc 'Test site output for Liquid template errors'
task :test => :build do
errors = `grep --exclude Rakefile -R 'Liquid error:' _site`
if errors.nil? || errors.empty?
puts "No errors"
else
puts "Errors:"
puts errors.inspect
exit 1
end
@jamiew
jamiew / megaplaya-advanced-embed.html
Created September 15, 2011 19:19 — forked from caseypugh/megaplaya-advanced-embed.html
Megaplaya Advanced Embed
<!DOCTYPE html>
<html>
<head>
<title>Megaplaya Advanced Embed demo</title>
</head>
<body>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"></script>
<script type="text/javascript" src="http://vhx.tv/javascripts/jquery.swfobject-1.1.1.js"></script>
@jamiew
jamiew / connection_fix.rb
Created August 23, 2011 16:52 — forked from defunkt/connection_fix.rb
MySQL server has gone away fix
# If your workers are inactive for a long period of time, they'll lose
# their MySQL connection.
#
# This hack ensures we re-connect whenever a connection is
# lost. Because, really. why not?
#
# Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar)
#
# From:
# http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/
@jamiew
jamiew / build-failed
Created July 31, 2011 21:48
A CI Joe build-failed hook that includes the test results in the email notification.
# .git/hooks/build-failed
echo -e "http://cijoe-server:4567\n\n" | cat - .git/builds/last | mail -s 'CI: Build failed!' recipient@domain.com
@jamiew
jamiew / textmate_bundler_updater.sh
Created April 10, 2011 17:00
Updates the system-wide TextMate bundles + all your user bundles, with some notes for additions I want to make (e.g. subversion support in user bundles -- I have one that still uses svn)
#!/bin/bash
CORE_PATH="/Library/Application Support/TextMate/Bundles/"
USER_PATH="/Users/$(whoami)/Library/Application Support/TextMate/Bundles/"
echo "Updating core TextMate bundles..."
cd "${CORE_PATH}"
#svn up *.tmbundle
svn up
@jamiew
jamiew / gist:371619
Created April 19, 2010 20:59 — forked from atmos/gist:227332
Spec for enforcing whitespace
require File.dirname(__FILE__) + '/spec_helper'
describe "The library itself" do
Spec::Matchers.define :have_no_tab_characters do
match do |filename|
@failing_lines = []
File.readlines(filename).each_with_index do |line,number|
@failing_lines << number + 1 if line =~ /\t/
end
@failing_lines.empty?