Skip to content

Instantly share code, notes, and snippets.

View jsmestad's full-sized avatar
👾

Justin Smestad jsmestad

👾
View GitHub Profile
@jcf
jcf / MIT License
Created April 13, 2011 17:02
RSpec matcher for parsing `response.headers['Content-Type']`
Copyright (c) 2012 James Conroy-Finn
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE US
@quinn
quinn / all_the_toys.rb
Created April 14, 2011 16:25
all the fun stuff i use in my default stack!
# data
gem 'carrierwave'
gem 'fog'
gem 'mini_magick'
gem 'resque'
gem 'mysql', group: :development
gem 'pg', group: :production
# controllers and views
gem 'haml-rails'
@jsmestad
jsmestad / element_by_text.rb
Created April 17, 2011 20:15
capybara element by text
Capybara.add_selector(:element_by_text) do
xpath { |locator| XPath.descendant[XPath.text.normalize == locator] }
end
When /^(?:|I )click "([^"]*)"$/ do |link|
begin
click_link(link)
rescue Capybara::ElementNotFound
find(:element_by_text, link).click
end
@aiwilliams
aiwilliams / config.rb
Created May 2, 2011 21:31
Sprockets producing Handlebars templates from Haml
http_path = "/"
css_dir = "public/stylesheets"
sass_dir = "sass"
images_dir = "public/images"
http_images_dir = "images"
javascripts_dir = "public/javascripts"
fonts_dir = "public/fonts"
http_fonts_dir = "fonts"
@ryanb
ryanb / rails_3_1_rc4_changes.md
Created May 6, 2011 01:10
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 RC4

  • The new rake task assets:clean removes precompiled assets. [fxn]

  • Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]

  • Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]

  • Template generation for jdbcpostgresql #jruby [Vishnu Atrai]

@tommeier
tommeier / save_screenshots_snippets.rb
Created May 18, 2011 02:06
Save screenshots when using Selenium, Capybara and Ubuntu server
#WIP
#spec/spec_helper.rb
RSpec.configure do |config|
#Only for selenium based tested filtered with :js => true on tests
#eg: describe "Some test", :js => true do
# end
config.around(:each, :js => true) do |example|
@foogoof
foogoof / webtail.js
Created May 18, 2011 12:29
Express / node / socket.io code to stream unix child process output over websockets
//
// Just skip to the bottom
//
var express = require('express');
var io = require('socket.io');
var app = module.exports = express.createServer();
// Configuration
@jejacks0n
jejacks0n / gist:990160
Created May 25, 2011 01:40
Adding sprockets to evergreen for rails 3.1 and coffeescript (via /config/evergreen.rb)
# For Rails 3.1 asset packaging / sprockets support
# 1. Create a /config/evergreen.rb file and put these contents in it
# 2. Adjust the paths below (the provided ones are generic)
require ::File.expand_path('../application', __FILE__)
module Evergreen
class << self
def application_with_additions(suite)
app = application_without_additions(suite)
@jsmestad
jsmestad / accessing_snapshot.rb
Created May 26, 2011 20:16
Proposed changes for Mongomatic 0.9.0
@snapshot = Snapshot.first
-----
{
:stats => {
'accounts' => { 'count' => 8 },
'subscriptions' => { 'count' => 16 }
},
:activity => [ {'ns' => 'accounts.users', ...}, {'ns' => 'subscriptions.users' =>, ...} ]
}
-----
@scottmessinger
scottmessinger / gist:1033617
Created June 19, 2011 00:09
Backbone.js todos vs knockout.js todos
We couldn’t find that file to show.