Skip to content

Instantly share code, notes, and snippets.

form.formtastic fieldset ol li { display: block; margin-bottom:.5em; }
form.formtastic fieldset {border:1px solid #CCC; width:400px; padding:15px; margin:15px;}
form.formtastic fieldset ol li label { display:block; width:200px; float:none; padding-top:.2em; }
form.formtastic legend { margin-bottom: 15px;}
form.formtastic legend span { background-color: #666; padding:8px; color:#FFF; }
form.formtastic .numeric { width:60px;}
@mrrooijen
mrrooijen / Capistrano-Deployment-Recipe.rb
Created July 29, 2009 09:34
a "base" Capistrano Rails Deployment Recipe. Use it to deploy your Rails application. It is also easily expandable. So feel free to grab this Recipe and add your own tasks/customization!
# Guide
# Configure the essential configurations below and do the following:
#
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
#
# Initial Deployment:
@benvds
benvds / gist:170983
Created August 20, 2009 10:58
formtastic stylesheet changes to place input fields beneath labels
/* @override http://localhost:3000/stylesheets/formtastic_changes.css */
form.formtastic > li {
list-style: none;
margin: 0 0 1em 0;
}
form.formtastic > li > label {
display: block;
}
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D
rails_env = ENV['RAILS_ENV'] || 'production'
# 16 workers and 1 master
worker_processes (rails_env == 'production' ? 16 : 4)
# Load rails+github.git into the master before forking workers
# for super-fast worker spawn times
preload_app true
/* -------------------------------------------------------------------------------------------------
It's *strongly* suggested that you don't modify this file. Instead, load a new stylesheet after
this one in your layouts (eg formtastic_changes.css) and override the styles to suit your needs.
This will allow you to update formtastic.css with new releases without clobbering your own changes.
This stylesheet forms part of the Formtastic Rails Plugin
(c) 2008 Justin French
--------------------------------------------------------------------------------------------------*/
@textarcana
textarcana / cucumber_cheatsheet.markdown
Created December 22, 2009 01:47
Cucumber cheatsheet

Cucumber cheatsheet

Best cheatsheet is: cucumber --help

Output formats

Reporting

Notification formats, in increasing order of verbosity:

@yeban
yeban / xmonad.hs
Created February 22, 2010 11:39
xmonad.hs used to run xmonad with Xfce4
--
-- xmonad example config file.
--
-- A template showing all available configuration hooks,
-- and how to override the defaults in your own xmonad.hs conf file.
--
-- Normally, you'd only override those defaults you care about.
--
import XMonad
@remy
remy / details.js
Created April 18, 2010 22:28
Add <details> support - includes stylesheet
/**
* Note that this script is intended to be included at the *end* of the document, before </body>
*/
(function (window, document) {
if ('open' in document.createElement('details')) return;
// made global by myself to be reused elsewhere
var addEvent = (function () {
if (document.addEventListener) {
return function (el, type, fn) {
@nusco
nusco / dynamic_proxy.rb
Created August 18, 2010 15:14
Spell: Dynamic Proxy
# ====================
# Spell: Dynamic Proxy
# ====================
# Forward to another object any messages that don’t match a method.
class MyDynamicProxy
def initialize(target)
@target = target
end
@szimek
szimek / capybara_select_dates_and_times.rb
Created August 31, 2010 09:26
Cucumber steps for selecting time and date (using Capybara)
require "xpath" # XPath is a separate gem now
module Cucumber
module Rails
module CapybaraSelectDatesAndTimes
def select_date(field, options = {})
date = Date.parse(options[:with])
selector = %Q{.//fieldset[contains(./legend, "#{field}")]}
within(:xpath, selector) do
find(:xpath, '//select[contains(@id, "_1i")]').find(:xpath, ::XPath::HTML.option(date.year.to_s)).select_option