Skip to content

Instantly share code, notes, and snippets.

View bouchard's full-sized avatar

Brady Bouchard bouchard

View GitHub Profile
@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'
/*
* 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" />
#!/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 "*******************************************************"
<?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);
<?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
*/
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
---
RewriteEngine on
RewriteBase /
RewriteCond SUBDIR/%{REQUEST_FILENAME} !-f
RewriteRule ^(.*) SUBDIR/$1 [L]
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(-)