Skip to content

Instantly share code, notes, and snippets.

View benjaminwood's full-sized avatar
👨‍💻
Workin'

Benjamin Wood benjaminwood

👨‍💻
Workin'
View GitHub Profile
activeadmin (0.6.3) lib/active_admin/inputs/filter_boolean_input.rb:19:in `checked?'
formtastic (2.1.1) lib/formtastic/inputs/boolean_input.rb:72:in `check_box_html'
activeadmin (0.6.3) lib/active_admin/inputs/filter_boolean_input.rb:9:in `block in to_html'
actionpack (3.2.13) lib/action_view/helpers/capture_helper.rb:40:in `block in capture'
actionpack (3.2.13) lib/action_view/helpers/capture_helper.rb:187:in `with_output_buffer'
haml (3.1.7) lib/haml/helpers/xss_mods.rb:109:in `with_output_buffer_with_haml_xss'
actionpack (3.2.13) lib/action_view/helpers/capture_helper.rb:40:in `capture'
haml (3.1.7) lib/haml/helpers/action_view_mods.rb:105:in `capture_with_haml'
activeadmin (0.6.3) lib/active_admin/inputs/filter_base.rb:11:in `input_wrapping'
activeadmin (0.6.3) lib/active_admin/inputs/filter_boolean_input.rb:7:in `to_html'
@benjaminwood
benjaminwood / active_admin_boolean_checked.rb
Created February 14, 2014 22:47
# Active admin relies on a method "boolean_checked?" that is part of a newer version of formtastic that we cannot upgrade to because of surveyor compatibility. This is an initializer monkey patch.
module ActiveAdmin
module Inputs
class FilterBooleanInput < ::Formtastic::Inputs::BooleanInput
def boolean_checked?(value, checked_value)
case value
when TrueClass, FalseClass
value
when NilClass
false
@benjaminwood
benjaminwood / gist:8479144
Created January 17, 2014 18:47
Rdio crash report
Process: Rdio [32512]
Path: /Applications/Rdio.app/Contents/MacOS/Rdio
Identifier: com.rdio.desktop
Version: 2.25 (2.25)
Code Type: X86 (Native)
Parent Process: launchd [396]
Responsible: Rdio [32512]
User ID: 501
Date/Time: 2014-01-17 10:45:54.737 -0800
@benjaminwood
benjaminwood / pricing.html.haml
Last active December 25, 2015 21:59
Boostrap 3, three tier pricing table (with fourth column for general details or buttons. Not completely finished, but a good starting point.
#pricing
.arrow-down
.container
.fancy-heading
%h2.heading Pricing
.center-block
.row
.col-md-3.option.tier_1
.header
%span.title Single
@benjaminwood
benjaminwood / liquid_filters.rb
Created September 10, 2013 16:27
Simple Locomotive CMS image resizing/cashing using (free) proxy service http://images.weserv.nl. Drop this file in your engine's config/initializers directory, restart your rails server and use the filter like this: {{ image_path | scaled_image_url: 'widthxheight' }} Example: {{ post.image.url | scaled_image_url: '1096x616' }}
module Locomotive
module Liquid
module Filters
module Text
# Create a url that will result in the given image
# being scaled and compressed by the specified amount
#
# For more info see: http://images.weserv.nl/
#