Skip to content

Instantly share code, notes, and snippets.

@mojavelinux
mojavelinux / test-asciidoctor.rb
Last active January 15, 2018 17:42
A Ruby script to load and render an AsciiDoc file using AsciiDoctor.
##!/usr/bin/env ruby
quiet = false
print = false
header_footer = true
while ARGV[0].to_s.start_with?('-')
case ARGV[0]
when '-o'
print = true
ARGV.shift
@ozgun
ozgun / simple_form_nested_inputs.html.erb
Created December 3, 2012 16:34
simple_form nested inputs
<%= f.input :kind, label: t('category.post.display.display') do %>
<%= f.input_field :kind, as: :select,
collection: [[t('category.post.display.full'), 'full'], [t('category.post.display.summary'), 'short'],
[t('category.post.display.word.word'), 'word']],
include_blank: false %>
<%= f.input :word_count, label: t('category.post.display.word.count'), wrapper_html: { id: 'category_word_count_div', class: 'hidden' } %>
<%= f.input :image_container, wrapper_html: { id: 'img_container', class: "hidden" }, label: t('image.image') do %>
<%= f.input_field :img, as: :boolean %>
@nruth
nruth / cookie_steps.rb
Created July 21, 2010 17:16
Testing login "remember me" feature with Capybara (rack::test or selenium) - deleting the session cookie (only)