Skip to content

Instantly share code, notes, and snippets.

@benhutton
benhutton / test.html
Created April 4, 2012 17:43
test.html
<h1>hi</h1>
static VALUE
rb_str_each_line(int argc, VALUE *argv, VALUE str)
{
rb_encoding *enc;
VALUE rs;
unsigned int newline;
const char *p, *pend, *s, *ptr;
long len, rslen;
VALUE line;
int n;
{"UPS Ground"=>882,
"UPS Three-Day Select"=>1322,
"UPS Second Day Air"=>1780,
"UPS Next Day Air Saver"=>4238,
"UPS Next Day Air Early A.M."=>8125,
"UPS Next Day Air"=>4622}
def backtrack(grid, row)
if matches?(grid, row)
if row == (grid.length - 1) # If we've matched everything!
return true
end
else
return false
end
for i = 0; i < grid.length, i++
Dgnetwork::Application.routes.draw do
# Everything that would normally go in /, and that I would put in /store
routes_for_spree_store do
end
# Everything that would normally go in /admin
routes_for_spree_admin do
# This is the application's routes.rb: config/routes.rb
Dgnetwork::Application.routes.draw do
ActionDispatch::Routing::Mapper.send :include, SpreeCore::Routes
scope :path => 'store' do
match '/' => 'store#index', :as => 'store'
routes_for_spree
end
@benhutton
benhutton / spree_site.rb
Created March 1, 2011 21:43
How to fix spree's default engine
module SpreeSite
class Engine < Rails::Engine
def self.activate
# Add your custom site logic here
end
paths.config.routes = "lib/spree_blank.rb"
paths.config.initializers = "lib/spree_blank.rb"
config.to_prepare &method(:activate).to_proc
end
es:
languages:
en: "English"
es: "Spanish"
cn: "Chinese-Simplified"
prepositions:
by: "by"
prep_on: "on"
view:
will_paginate:
hi
hi
hi
<form action="http://www.desiringgod.org/Store/donation_process/" method="post">
<div class="amount">
<h5 style="display:block;width:400px;margin:0 0 10px;">Select the amount of your monthly donation:</h5>
<input name="donation[9][amount]" value="5" type="radio" size="6" /> $5 per month
<br /><input name="donation[9][amount]" value="15" type="radio" size="6" /> $15 per month
<br /><input name="donation[9][amount]" value="25" type="radio" size="6" /> $25 per month
<br /><input name="donation[9][amount]" value="Other" type="radio" size="6" />
<span style="padding:0 3px 0 0;">$</span><input name="donation[9][amount_override]" value="" type="text" size="6" /> per month
<input type="hidden" name="donation&#91;9&#93;[recurring]" id="donation&#91;9&#93;[recurring]" value="1" />
</div>