Back in Melbourne circa 2010/11, Jodie, Jared and I used to run a [monthly vegan mentoring group][vegan-month]. I have gone back through the mailing lists and collected much of the curriculum and information from the program into this single document, so that I can distribute it more widely. The program was designed not just to get you through the first month nutritionally, but to expose you to a variety of foods and ideas that may be new to you. It emphasises that veganism is a shift sideways, not a sacrifice.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rack/request' | |
require 'rack/response' | |
class App | |
attr_accessor :provider | |
# This constructor DI is not possible in Sinatra(?), since the framework | |
# creates the new instance for you. | |
def initialize(provider) | |
@provider = provider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapter from http://pivotallabs.com/users/jdean/blog/articles/1707-using-mysql-foreign-keys-procedures-and-triggers-with-rails | |
namespace :db do | |
namespace :structure do |schema| | |
schema[:dump].abandon | |
desc "OVERWRITTEN - shell out to mysqldump" | |
task :dump => :environment do | |
cmd = "mysqldump #{mysql_options} -d --routines --triggers --skip-comments > db/development_structure.sql" | |
system cmd | |
File.open("#{Rails.root}/db/#{Rails.env}_structure.sql", "a") { |f| f << ActiveRecord::Base.connection.dump_schema_information } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Volunteer role available: TECHNOLOGY TEAM: Project Manager | |
Description: | |
Working with the BZE technology team in Melbourne, this role involves managing the tasks for the various technology volunteers. We are currently rolling out a new website and CRM database. As our team grows, we now need someone to help manage tasks and to ensure volunteer time and skills are being utilized as efficiently as possible. | |
This role is a great opportunity to apply your management skills to a very important role that will see the deployment of the next generation of core tools used by BZE to research and communicate, helping to keep BZE one step ahead in climate change action! | |
Requirements: A basic understanding of project management and working with coders. You will understand the difference between a CRM and MYSQL. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns ocr.main | |
(:use [clojure.string :only (split trim)]) | |
(:use [clojure.contrib.duck-streams :only (write-lines read-lines)]) | |
(:use [clojure.contrib.shell-out :only (sh)]) | |
(:use [clojure.contrib.math :only (sqrt)])) | |
; Input handling | |
(defn read-text-image-line [line] | |
(if (= "white" (last (split line #"[,:\s]+"))) "0" "1")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController | |
# Provide access to helper methods from outside controllers and views, | |
# such as in Presenter objects. Rails provides ActionController::Base.helpers, | |
# but this does not include any of our application helpers. | |
def self.all_helpers | |
@all_helpers_proxy ||= begin | |
# Start with just the rails helpers. This is the same method used | |
# by ActionController::Base.helpers | |
proxy = ActionView::Base.new.extend(_helpers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In ruby you can mock everything, but get no indication when you forget to change underlying methods. | |
# In Java, this would be picked up by the compiler. | |
# This makes mocking in ruby more fragile. | |
# What if you were only allowed to mock methods on an "interface"? In the simple case | |
# this is just a class, but could be a module for re-use. | |
require 'minitest/unit' | |
require 'minitest/mock' | |
require 'minitest/autorun' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'parallel' | |
class AcceptanceRunner < MiniTest::Unit | |
def initialize(opts = {}) | |
super() | |
@opts = opts | |
end | |
def _run_suites_in_parallel(suites, type) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/.gitignore b/.gitignore | |
index 57557c9..7955376 100644 | |
--- a/.gitignore | |
+++ b/.gitignore | |
@@ -129,3 +129,4 @@ y.tab.c | |
# /win32/ | |
/win32/*.ico | |
+ext/win32ole/.document | |
diff --git a/array.c b/array.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class QueryTraceLogger | |
def initialize(logger) | |
@logger = logger | |
end | |
def method_missing(method_name, *args) | |
if method_name == :debug | |
if args.first =~ /SQL/ | |
Rails.logger.debug "" | |
Rails.backtrace_cleaner.clean(caller).each do |line| |