Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Guterl mguterl

View GitHub Profile
View vegan-month.md

Vegan Month Logo

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.

View gist:9603167
### Keybase proof
I hereby claim:
* I am mguterl on github.
* I am mguterl (https://keybase.io/mguterl) on keybase.
* I have a public key whose fingerprint is C674 EE7D 53FF F4FB DE26 81BC 178E 043C AE0D F0C7
To claim this, I am signing this object:
View gist:11045879
namespace :pgbackup do
desc 'capture pgbackup from production'
task :capture => :environment do
system("heroku pgbackups:capture --expire")
end
desc 'download most recent pgbackup from production and put in ../pgbackups'
task :download => :environment do
timestamp = Time.now.utc.strftime("%Y%m%d%H%M%S")
system("curl -o #{Rails.root.join("pgbackups", "production_#{timestamp}.dump")} --create-dirs `heroku pgbackups:url`")
View credit_card_helper.rb
#this is a very simple, work in progress helper method for stubbing the stripe checkout.js
#this creates a fake server that will generate stripe token as if it's coming from stripe. So we can test credit card input
class FakeStripe < Sinatra::Base
def self.boot
instance = new
Capybara::Server.new(instance).tap { |server| server.boot }
end
get '/checkout.js' do
View pgbackups.rake
namespace :pgbackup do
desc 'capture pgbackup from production'
task :capture => :environment do
system("heroku pgbackups:capture --expire")
end
desc 'download most recent pgbackup from production and put in ../pgbackups'
task :download => :environment do
timestamp = Time.now.utc.strftime("%Y%m%d%H%M%S")
system("curl -o #{Rails.root.join("pgbackups", "production_#{timestamp}.dump")} --create-dirs `heroku pgbackups:url`")
View gist:13466
WIN32 = %r/djgpp|(cyg|ms|bcc)win|mingw/ =~ RUBY_PLATFORM unless defined? WIN32
DEV_NULL = WIN32 ? 'NUL:' : '/dev/null'
def quiet( &block )
io = [STDOUT.dup, STDERR.dup]
STDOUT.reopen DEV_NULL
STDERR.reopen DEV_NULL
block.call
ensure
View gist:13473
def quiet( &block )
io = STDOUT.dup
STDOUT.reopen '/dev/null', 'w'
block.call
STDOUT.reopen io
end
quiet { puts "hello" }
quiet { puts "hello" } # take this out and it works
View matrix_maker.rb
class Nav
def self.padded_selector(sel, max_len)
sel.ljust(max_len)
end
attr_accessor :id, :height, :items, :image
def initialize(attrs={})
attrs.each { |k,v| send("#{k}=", v) }
end
View sshd_config
# Package generated configuration file
# See the sshd(8) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
View gist:54598
#! /usr/bin/env ruby
Main {
description <<-txt
pimp3 is easily the greatest program ever written. if you can't figure
out what it does hook up some electrodes to your genitals and crank it
up fuckers!
txt
author 'ara.t.howard @ gmail.com'