Skip to content

Instantly share code, notes, and snippets.

View textgoeshere's full-sized avatar

Dave Nolan textgoeshere

View GitHub Profile
# Kapoq Rails template
# TODO:
# timeformats
# concerns
# core extensions
# lowpro
# mysql/sqlite users and db config
# FIXME:
# HaveFilter matchers for RSpec
# forked from http://gist.github.com/200099
#
# Require in spec_helper.rb and add the following to your spec config block:
# config.include(Shoulda::ActionController::Matchers), :type => :controllers
#
# class HomeController < ApplicationController
# before_filter :require_user, :except => [:action_1, :action_2]
# ...
# end
>> node = Chef::Node.load(FQDN); nil
I, [2010-09-16T13:03:45.043798 #6792] INFO -- : CONNECT: [SERVER, 4000]
I, [2010-09-16T13:03:45.044017 #6792] INFO -- : GET /nodes/FQDN
I, [2010-09-16T13:03:48.330086 #6792] INFO -- : BODY: Net::HTTPOK
=> nil
>> x = node.lsb
=> #<Chef::Node::Attribute @auto_vivifiy_on_read=false, @automatic={...}, @default={...}, @current_normal=nil, @has_been_read=false, @current_automatic={"codename"=>"lucid", "id"=>"Ubuntu", "description"=>""Ubuntu 10.04.1 LTS"", "release"=>"10.04"}, normal{....}, set_typenil, state[:lsb], current_overridenil, set_unless_value_presentfalse, override{....}, current_defaultnil
>> x.codename
=> "lucid"
>> x.codename
This is a test
@textgoeshere
textgoeshere / deploy.rb
Created February 7, 2011 10:56
fitz-twit deploy skeleton
require 'yaml'
require 'lib/core_extensions/hash'
require 'capistrano/ext/multistage'
set :stages, %w(staging)
unset :deploy_to
set :scm, :git
set :repository, 'gitosis@kapoq.com:fitz-twit'
set :git_enable_submodules, true
@textgoeshere
textgoeshere / coffeescript compilation order weirdness.coffee
Created May 6, 2011 17:59
coffeescript compilation order weirdness
class window.SpreadsController extends Backbone.Controller
routes:
"/sports":"sports"
"/markets":"markets"
constructor: ->
super
window.sport_manager = new SportManagerView()
#!/bin/sh
echo "adding xPUD 0.9.2" >&2
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "xPUD 0.9.2" {
set isofile="/boot/iso/xpud-0.9.2.iso"
loopback loop (hd0,1)$isofile
# Force backtraces from Thin to output to STDERR
# workaround for http://stackoverflow.com/questions/4627928/get-rails-exceptions-to-show-using-capybara-and-selenium
module Thin::Logging
def log_error(e=$!)
STDERR.print "#{e}\n\t" + e.backtrace.join("\n\t")
end
end
@textgoeshere
textgoeshere / 1.8.7@rails2
Created June 21, 2011 14:53
Ruby 1.9.2@rails3 is 8x slower than 1.8.7@rails2
Using /home/dave/.rvm/gems/ruby-1.8.7-p334 with gemset rails2-3-10
$ time spec spec/views/people/_header.haml_spec.rb
No server is running
Running specs locally:
......
Finished in 1.522537 seconds
6 examples, 0 failures
module Firebug
VERSION = "1.6.2"
end
Capybara.register_driver :selenium_with_firebug do |app|
require 'selenium/webdriver'
profile = Selenium::WebDriver::Firefox::Profile.new
profile.add_extension("spec/support/firebug-#{Firebug::VERSION}.xpi")