Skip to content

Instantly share code, notes, and snippets.

View bouchard's full-sized avatar

Brady Bouchard bouchard

View GitHub Profile
@bouchard
bouchard / keybase.md
Created September 17, 2014 23:07
Keybase Proof

Keybase proof

I hereby claim:

  • I am bouchard on github.
  • I am brady (https://keybase.io/brady) on keybase.
  • I have a public key whose fingerprint is 9F51 0077 BCBA AC87 3017 DD84 9FF6 1476 A7C4 DFF6

To claim this, I am signing this object:

@bouchard
bouchard / state_machine.rb
Created December 25, 2014 20:05
Hack to Get Rails 4.1.0.rc1 through 4.2.0 to work with state_machine
# Rails 4.1.0.rc1 through 4.2.0 and StateMachine don't play nice
# https://github.com/pluginaweek/state_machine/issues/295
# https://github.com/pluginaweek/state_machine/issues/314
require 'state_machine/version'
unless StateMachine::VERSION == '1.2.0'
# If you see this message, please test removing this file
# If it's still required, please bump up the version above
Rails.logger.warn "Please remove me, StateMachine version has changed."
From b203bad71d53c4278dc97c30c0827b0430bae3ad Mon Sep 17 00:00:00 2001
From: Brady Bouchard <brady@lunardawn.ca>
Date: Fri, 14 Nov 2008 13:20:04 -0700
Subject: [PATCH] Added basic support for Rails 2.2 using compiled templates.
Options that affect the response header (pragma, cache-control, content-disposition) are not enabled.
Options passed to Prawn work as usual.
---
lib/prawnto/template_handler/base.rb | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
RewriteEngine on
RewriteBase /
RewriteCond SUBDIR/%{REQUEST_FILENAME} !-f
RewriteRule ^(.*) SUBDIR/$1 [L]
From 67375bb902354b41bf99cb3ffbb9b4864c86e139 Mon Sep 17 00:00:00 2001
From: Brady Bouchard <brady@lunardawn.ca>
Date: Mon, 1 Feb 2010 14:24:13 +1000
Subject: [PATCH] Added an option to force all tags to lowercase.
Use:
Put
TagList.force_lowercase = true
in environment.rb
---
<?php
/*
Plugin Name: Gcal Sidebar
Plugin URI: http://www.oriontechnologysolutions.com/gcal-sidebar/
Description: Pulls a Google Calendar feed and displays it in your sidebar.
Version: 1.0
Author: Orion Technology Solutions
Author URI: http://www.oriontechnologysolutions.com
*/
<?php
header('Content-type: text/csv; charset=utf-8');
$xml = simplexml_load_file('mnemosyne.xml');
$lines = array();
foreach($xml->item as $item) {
$q = $item->Q;
$q = strip_tags((string) $q, '<u><ul><li>');
$q = str_replace('<dt>','',$q);
#!/usr/bin/env ruby
## Modified from Gem Session's Dumple, available at:
## http://gem-session.com/2010/07/dumping-database-from-within-rails-project
fail_gently = ARGV.include?("--fail-gently")
gzip = ARGV.include?("--compress")
if ARGV.include?("-i")
puts "*******************************************************"
/*
* svgObject: a jQuery plugin, version: 0.1 (2010-09-03)
* @requires jQuery v.1.4.2 or later
*
* svgObject parses all SVG images linked in the document as IMG tags, and replaces
* the IMG tags with OBJECTs instead to make it all work nicely in FF 3.6+ and Safari 5+
*
* This:
*
* <img class="up svg" src="/images/up.svg" />
@bouchard
bouchard / Rules
Created November 18, 2011 06:43
Nanoc Nested Routes with RecursiveCompilation Error
compile '/' do
filter :erb
layout 'default'
end
compile '*' do
# item[:extension] returns 'html.erb' for multi-dotted filename
ext = item[:extension].nil? ? nil : item[:extension].split('.').last
if ext == 'erb'