Skip to content

Instantly share code, notes, and snippets.

@stijlist
stijlist / _form.html.haml
Created June 10, 2012 16:58
Trying to add CSS classes to form_for
= form_for (@user, :html => {:class => "well"}) do |f|
-if @user.errors.any?
#error_explanation
%h2= "#{pluralize(@user.errors.count, "error")} prohibited this user from being saved:"
%ul
- @user.errors.full_messages.each do |msg|
%li= msg
.field
= f.label :fname
@stijlist
stijlist / ex-vi-cloc
Last active December 16, 2015 08:39
WebKit / WebCore Complexity
[code-reads]% cd ex-vi ○
[ex-vi]% cloc . ± master f027810
59 text files.
56 unique files.
47 files ignored.
http://cloc.sourceforge.net v 1.58 T=1.0 s (50.0 files/s, 28714.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
@stijlist
stijlist / credit_cards.html
Last active December 21, 2015 01:39
Stripe code for my church's Youth Fellowship website.
<!DOCTYPE html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7 ]> <html class="ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
@stijlist
stijlist / _form.html.erb
Created August 17, 2013 15:44
Trying to understand why my submit handlers don't fire in the new action of a default rails 4 controller.
<h1>Charge $10 with Stripe</h1>
<form action="" method="POST" id="payment-form">
<span class="payment-errors"></span>
<div class="form-row">
<label>
<span>Card Number</span>
<input type="text" size="20" data-stripe="number"/>
</label>
@stijlist
stijlist / brew-doctor-output.txt
Created October 11, 2013 09:38
Rubinius fails to build on 10.8
bash-3.2$ brew doctor
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
<section class='retreat-theme'>
<div class="row">
<div class="large-12 columns center">
<div class="retreat-heading">
<p class="retreat-date">January 10-12, 2014</p>
<h1 class="retreat-logo">Whatcha Gonna Do?</h1>
<h4 class="retreat-verse">"Do not merely listen to the word, and so deceive yourselves. Do what it says." - James 1:22</h4>
<span class="retreat-amount">$85</span>
</div>
</div>
<section class='retreat-theme'>
<div class="row">
<div class="large-12 columns center">
<div class="retreat-heading">
<p class="retreat-date">January 10-12, 2014</p>
<h1 class="retreat-logo">Whatcha Gonna Do?</h1>
<h4 class="retreat-verse">"Do not merely listen to the word, and so deceive yourselves. Do what it says." - James 1:22</h4>
<span class="retreat-amount">$85</span>
</div>
</div>
NoMethodError - undefined method `type' for nil:NilClass:
activerecord (4.0.0) lib/active_record/attribute_methods/time_zone_conversion.rb:54:in `create_time_zone_conversion_attribute?'
activerecord (4.0.0) lib/active_record/attribute_methods/time_zone_conversion.rb:34:in `define_method_attribute='
activemodel (4.0.0) lib/active_model/attribute_methods.rb:286:in `block in define_attribute_method'
activemodel (4.0.0) lib/active_model/attribute_methods.rb:279:in `define_attribute_method'
activemodel (4.0.0) lib/active_model/attribute_methods.rb:246:in `block in define_attribute_methods'
activemodel (4.0.0) lib/active_model/attribute_methods.rb:246:in `define_attribute_methods'
activerecord (4.0.0) lib/active_record/attribute_methods.rb:29:in `block in define_attribute_methods'
activerecord (4.0.0) lib/active_record/attribute_methods.rb:26:in `define_attribute_methods'
activerecord (4.0.0) lib/active_record/attribute_methods.rb:167:in `respond_to?'
#!/usr/bin/ruby
# tp-dailylog.rb - Log TaskPaper tasks completed on the current day to a Day One entry
# Brett Terpstra 2012 <http://brettterpstra.com>
#
# Run it with launchd at 11pm and forget about it
#
# Notes:
# * Uses `mdfind` to locate all .taskpaper files changed in the last day
# * Scans for @done(xxxx-xx-xx) tags in each line matching today's date
# * Does not alter TaskPaper files in any way
INFO [62ef3222] Running RBENV_ROOT=/usr/local/rbenv RBENV_VERSION=2.1.1 /usr/local/rbenv/bin/rbenv exec bundle install --binstubs /home/deploy/apps/tmcyf_production/shared/bin --path /home/deploy/apps/tmcyf_production/shared/bundle --without development test --deployment --quiet on 162.243.103.14
DEBUG [62ef3222] Command: cd /home/deploy/apps/tmcyf_production/releases/20140417060020 && ( RBENV_ROOT=/usr/local/rbenv RBENV_VERSION=2.1.1 RBENV_ROOT=/usr/local/rbenv RBENV_VERSION=2.1.1 /usr/local/rbenv/bin/rbenv exec bundle install --binstubs /home/deploy/apps/tmcyf_production/shared/bin --path /home/deploy/apps/tmcyf_production/shared/bundle --without development test --deployment --quiet )
DEBUG [62ef3222] Unfortunately, a fatal error has occurred. Please see the Bundler
DEBUG [62ef3222]
DEBUG [62ef3222] troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
DEBUG [62ef3222]
DEBUG [62ef3222] /usr/local/rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/bundler-1.6.2/lib/bundler/