Skip to content

Instantly share code, notes, and snippets.

View joemsak's full-sized avatar

Joe Sak joemsak

View GitHub Profile
var custom_wymeditor_boot_options = {
skin: 'refinery'
, containersItems: [
{'name': 'h3', 'title':'Heading_3', 'css':'wym_containers_h3'}
, {'name': 'h4', 'title':'Heading_4', 'css':'wym_containers_h4'}
, {'name': 'h5', 'title':'Heading_5', 'css':'wym_containers_h5'}
, {'name': 'p', 'title':'Paragraph', 'css':'wym_containers_p'}
]
, classesItems: [
@joemsak
joemsak / heroku_compass.rb
Created April 28, 2011 17:13
With the latest compass config/compass.rb has a railtie now. Heroku instructions go here now.
project_type = :rails
project_path = Compass::AppIntegration::Rails.root
environment = Compass::AppIntegration::Rails.env
FileUtils.mkdir_p(Rails.root.join("tmp", "stylesheets"))
Rails.configuration.middleware.insert_before('Rack::Sendfile', 'Rack::Static',
:urls => ['/stylesheets'],
:root => "#{Rails.root}/tmp")
http_path = '/'
@evs
evs / gist:1121506
Created August 2, 2011 23:34 — forked from coop/Deploy
Deploy to S3 - Asset Pipeline, S3 and Heroku
namespace :deploy do
desc "Deploy to Heroku"
task :heroku do
Rake::Task["deploy:precompile_assets_and_upload_to_s3"].invoke
Rake::Task["deploy:push_heroku"].invoke
end
desc "Precompile assets and upload to s3"
task :precompile_assets_and_upload_to_s3 do
storage = Fog::Storage.new :provider => 'AWS', :aws_access_key_id => "123", :aws_secret_access_key => "123"
@joemsak
joemsak / Gemfile
Created November 1, 2011 19:25
Gems for testing capybara/rspec
group :development, :test do
gem 'rspec-rails', '~> 2.7.0'
gem 'capybara-webkit', '~> 0.7.2'
gem 'database_cleaner', '~> 0.6.7'
end
@joemsak
joemsak / spec_helper.rb
Created November 1, 2011 19:29
SpecHelper's Database Cleaner strategy
RSpec.configure do |config|
#...
config.use_transactional_fixtures = false
config.before(:suite) do
DatabaseCleaner.strategy = :truncation
end
#...
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'capybara/rspec'
Capybara.javascript_driver = :webkit
#...
@joemsak
joemsak / config_environments_test.rb
Created January 2, 2012 20:45
Reload changes in models during tests
config.cache_classes = !(ENV['DRB'] == 'true')
:map ,t :w\|:!rspec --color %<cr>
curl https://raw.github.com/garybernhardt/destroy-all-software-extras/master/das-0010-fast-tests-with-and-without-rails/test > script/test
class CanonicalRedirect
def initialize(app)
@app = app
end
def call(env)
request = Rack::Request.new(env)
#
#
#