Skip to content

Instantly share code, notes, and snippets.

@JohnPlummer
JohnPlummer / call_partial_1.rb
Created January 31, 2012 12:52
Optional Parameters in View Partials
render 'shared/events_table', events: @events, title: 'Your Events'
@JohnPlummer
JohnPlummer / .Gemfile
Created December 13, 2011 15:19
Rails 3.1 on Heroku, TLDR Version
source 'http://rubygems.org'
gem 'rails', '3.1.1'
gem 'thin'
gem 'pg'
# Gems used only for assets and not required
# in production environments by default.
<span style="unicode-bidi:bidi-override; direction: rtl">moc.niamod@eman</span>
@JohnPlummer
JohnPlummer / application1.rb
Created June 9, 2011 19:48
jquery-rails setting default scripts
# config.action_view.javascript_expansions[:defaults] = %w()
@JohnPlummer
JohnPlummer / .gvimrc
Created May 16, 2011 10:15
NerdTree Janus Fix
autocmd WinEnter * call s:CloseIfOnlyNerdTreeLeft()
" Close all open buffers on entering a window if the only
" buffer that's left is the NERDTree buffer
function s:CloseIfOnlyNerdTreeLeft()
if exists("t:NERDTreeBufName")
if bufwinnr(t:NERDTreeBufName) != -1
if winnr("$") == 1
q
endif
@JohnPlummer
JohnPlummer / header-bar.css
Created May 12, 2011 12:08
HTML5 WordPress Header
#header-bar {
height: 10px;
background: #1F1F1F;
-moz-box-shadow: 0 0 25px 5px rgba(0,0,0,0.5);
-webkit-box-shadow: 0 0 25px 5px rgba(0,0,0,0.5);
box-shadow: 0 0 25px 5px rgba(0,0,0,0.5);
}
@JohnPlummer
JohnPlummer / current_page_item.css
Created May 4, 2011 20:25
HTML5 Wordpress Footer
#nav-footer ul li.current_page_item > a {
pointer-events: none;
cursor: default;
color: #BED730;
}
@JohnPlummer
JohnPlummer / style.css
Created April 21, 2011 13:33
Customising Roots Theme
/*
Theme Name: Roots Child
Template: Roots
*/
@import url("../roots/style.css");
@JohnPlummer
JohnPlummer / compass.rb
Created April 14, 2011 16:00
Rails, Compass, and Heroku
require 'compass'
require 'compass/app_integration/rails'
require 'fileutils'
FileUtils.mkdir_p(Rails.root.join("tmp", "stylesheets"))
Compass::AppIntegration::Rails.initialize!
Rails.configuration.middleware.delete('Sass::Plugin::Rack')
Rails.configuration.middleware.insert_before('Rack::Sendfile', 'Sass::Plugin::Rack')
@JohnPlummer
JohnPlummer / stop.rb
Created February 23, 2011 11:59
Stop in rails console if something fails in cucumber test. From http://railsdog.com/blog/2011/02/22/cucumber-testing-tips/ (Neeraj Singh)
# Usage:
# @wip @stop
# At the end of features/support/env.rb add the following line
# require File.expand_path(File.dirname(__FILE__) + '/stop')
# $ cucumber -p wip
After do |scenario|
if scenario.failed? && scenario.source_tag_names.include?("@wip") && scenario.source_tag_names.include?("@stop")
puts "Scenario failed. You are in rails console becuase of @stop. Type exit when you are done"