Skip to content

Instantly share code, notes, and snippets.

View doxavore's full-sized avatar

Doug Mayer doxavore

View GitHub Profile
@doxavore
doxavore / presenter.rb
Created April 19, 2012 16:00 — forked from ahoward/presenter.rb
worlds simplest presenter pattern. drop in replacement for ActiveRecord/Mongoid models in your controller
# the worlds lightest weight presenter pattern. to use simply
#
# file app/presenters/post_presenter.rb
#
# PostPresenter =
# Presenter.for(Post) do
# validates_presence_of :custom_field_for_this_form
#
# end
#
@doxavore
doxavore / Vagrantfile
Created April 15, 2012 20:16
Vagrant configuration
##################################
### Custom additions from Krux
##################################
### Extensive documentation here:
### http://vagrantup.com/docs/vagrantfile.html
require 'etc'
owner = ENV['KRUX_MY_USERNAME'] || Etc.getlogin
hosts = {
@doxavore
doxavore / gist:1676687
Created January 25, 2012 15:07 — forked from dx7/gist:1333785
Installing ruby-debug with ruby-1.9.3-p0
# Install with:
# bash < <(curl -L https://raw.github.com/gist/1676687)
#
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug
echo "Installing ruby-debug with ruby-1.9.3-p0 ..."
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
@doxavore
doxavore / tmux.conf
Created November 13, 2011 15:47 — forked from bryanl/tmux.conf
I copied this from somewhere. It is a good start, though
# ~/.tmux.conf
#
# See the following files:
#
# /opt/local/share/doc/tmux/t-williams.conf
# /opt/local/share/doc/tmux/screen-keys.conf
# /opt/local/share/doc/tmux/vim-keys.conf
#
# URLs to read:
#
require 'java'
require 'jodconverter-cli-2.2.1.jar'
def convert(file_in,file_out)
inputFile = java.io.File.new(file_in)
outputFile = java.io.File.new(file_out)
# connect to an OpenOffice.org instance running on port 8100
connection = com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection.new(8100)
connection.connect()
require 'java'
require 'jodconverter-cli-2.2.1.jar'
def convert(file_in,file_out)
inputFile = java.io.File.new(file_in)
outputFile = java.io.File.new(file_out)
# connect to an OpenOffice.org instance running on port 8100
connection = com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection.new(8100)
connection.connect()
Given /^I visit subdomain "(.+)"$/ do |sub|
#host! "#{sub}.example.com" #for webrat
Capybara.default_host = "#{sub}.example.com" #for Rack::Test
Capybara.app_host = "http://#{sub}.example.com:9887" if Capybara.current_driver == :culerity
################################################################################
# As far as I know, you have to put all the {sub}.example.com entries that you're
# using in your /etc/hosts file for the Culerity tests. This didn't seem to be
# required for Rack::Test
################################################################################