Skip to content

Instantly share code, notes, and snippets.

View peterberkenbosch's full-sized avatar
:shipit:

Peter Berkenbosch peterberkenbosch

:shipit:
View GitHub Profile
var $tabs = $('#details > ul').tabs({
'select': function(e, ui) {
alert('selected!');
}
});
def help
Helper.instance
end
class Helper
include Singleton
include ActionView::Helpers::NumberHelper
end
# Link to local copy of edge rails
inside('vendor') { run 'ln -s ~/dev/rails rails' }
# Delete unnecessary files
run "rm README"
run "rm public/index.html"
run "rm public/favicon.ico"
run "rm public/robots.txt"
run "rm public/images/rails.png"
module Spree
module NorthernfliesCouponCalculator
class Calculator
def applyCoupon(order)
end
end
end
end
@peterberkenbosch
peterberkenbosch / select-into-example.sql
Created March 26, 2009 10:48
Howto export a query result from mysql into a csv file
SELECT order_id,product_name,qty
FROM orders
INTO OUTFILE '/tmp/orders.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
# Link to local copy of edge rails
#inside('vendor') { run 'ln -s ~/dev/rails rails' }
# Delete unnecessary files
run "rm README"
run "rm public/index.html"
run "rm public/favicon.ico"
run "rm public/robots.txt"
run "rm public/images/rails.png"
run "rm -f public/javascripts/*"
<div id="menu" >
<r:find url="/nl/">
<ul class="adxm menu">
<r:snippet name="menu" />
</ul>
</r:find>
</div>
The snippet "menu" :
# config.gem "rspec", :lib => false, :version => ">=1.2.6" unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec'))
# config.gem "rspec-rails", :lib => 'spec/rails', :version => ">=1.2.6" unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec-rails'))
OrderMailer.class_eval do
def confirm(order, resend = false)
@subject = (resend ? "[RESEND] " : "")
@subject += Spree::Config[:site_name] + ' ' + 'Order Confirmation #' + order.number
@body = {"order" => order}
@recipients = order.email
@from = Spree::Config[:order_from]
@bcc = order_bcc
@sent_on = Time.now
@content_type = "multipart/mixed"