Here's how to get up and running on Spree Commerce...
We'll be using Rails3 and the Bundler gem. So make sure you've got those installed before moving on....
First create a new rails project:
rails new my_spree_site
class TheOneAndOnlyKraken { | |
static let sharedInstance = TheOneAndOnlyKraken() | |
private init() {} //This prevents others from using the default '()' initializer for this class. | |
} |
class Calculator::PulpRate < Calculator | |
preference :category1_rate, :decimal, :default => 0 | |
preference :category2_rate, :decimal, :default => 0 | |
preference :category3_rate, :decimal, :default => 0 | |
preference :category4_rate, :decimal, :default => 0 | |
preference :category5_rate, :decimal, :default => 0 | |
WEIGHT_RANGES = { | |
0..350 => :preferred_category1_rate, | |
351..500 => :preferred_category2_rate, |
Here's how to get up and running on Spree Commerce...
We'll be using Rails3 and the Bundler gem. So make sure you've got those installed before moving on....
First create a new rails project:
rails new my_spree_site
# Fluent Factory overrides the new class method to provide an intuitive factory. | |
# Instead of using | |
# MyFactory.new_instance(args) | |
# Which may return an instance of MyClass, you now use | |
# MyClass.new(args) | |
# The second way is more intuitive and the big advantage is to use it rails and | |
# inheritance. | |
# | |
# Read the full example below to understand how to use it. | |
# class Animal |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
describe "GET current" do | |
before do | |
@request.cookies['hidden_notices'] = "1,#{notices(:permanent).id}" | |
get :current, :format => 'js' | |
end | |
it { should respond_with(:success) } | |
it { should set_cookie(:hidden_notices).to("#{notices(:permanent).id}") } | |
it { should render_template('notices/current') } | |
end |
#!/usr/bin/env python | |
import requests, sys, getopt | |
try: | |
opts, args = getopt.getopt(sys.argv[1:], "p:", ["port="]) | |
except getopt.GetoptError: | |
print('springboot.py -p <port>') | |
sys.exit(2) |
. | |
├── books | |
│ ├── handlers.go | |
│ └── models.go | |
├── config | |
│ └── db.go | |
└── main.go |