Goals
- Identify Areas of Performance Problems
- Prioritize by Pain
- Short Term Fixes
- Long term Fixes
- Bencharks measurements
Areas of Performance Problems
Goals
Areas of Performance Problems
# Generate this migration by running: | |
# | |
# bundle exec rails g migration add_handoff_to_spree_orders handoff:string | |
# bundle exec rake db:migrate | |
# | |
# db/migrate/add_handoff_to_orders.rb | |
class AddHandoffToOrders < ActiveRecord::Migration | |
def change | |
add_column :spree_orders, :handoff, :string |
# The fundamantal design opinion is that a Stock Return has many Returned Items | |
# Each Returned Item effectively has one of 3 actions associated with it return, exchange OR replace | |
# Any of these action can involve a refund, although the most common is that a return involves a refund | |
# You may wish to refund a replacement Or exchange to maintain customer relations | |
# | |
# Once all Returned Items and their actions have been set then you can commence to attempt to process the Stock Return | |
# Processing the Stock Return will automate the Order Adjustments, Addiitonal Shipments and any Refunds / Payments | |
# It should be exstensible so that developers can easily implement their own behaviour here | |
# | |
# It could be that a developer can extend this to Create New Orders instead of Additional Shipments under certain scenarios: |
class MagicPaginator | |
constructor: (el, options)-> | |
@callback = options.callback || -> false | |
@$el = $(el) | |
@$pagination = @$el.parent().find '.pagination' | |
return if @$pagination.length == 0 | |
@render() | |
$(window).scroll @scrollFetch |
# Adding a new state | |
Order.state_machine.states << skrill_state = StateMachine::State.new(Order.state_machine, 'skrill') | |
# Redefining an event | |
Order.state_machine.events << next_event = StateMachine::Event.new(Order.state_machine, :next) | |
next_event.transition :from => 'cart', :to => 'address' | |
next_event.transition :from => 'address', :to => 'delivery' | |
next_event.transition :from => 'delivery', :to => 'payment', :if => :payment_required? | |
next_event.transition :from => 'payment', :to => 'skrill', :if => lambda {true} | |
next_event.transition :from => 'skrill', :to => 'complete' |
task :env_checker do | |
unless Rails.env.development? | |
puts "Not in development environment, exiting!" | |
exit 1 | |
end | |
end | |
namespace :app_name do | |
desc 'Anonymize user, company, and location information' | |
task :anonymize => [:environment, :env_checker] do |
# Was asked how I keep my zshrc config sync'd between my computers with Dropbox | |
# Add a new directory in your Dropbox (or use an existing one) | |
mkdir -p ~/Dropbox/ohmyzsh | |
# move existing file to Dropbox | |
mv ~/.zshrc ~/Dropbox/ohmyzsh/zshrc | |
# symlink file back to your local directory | |
ln -s ~/Dropbox/ohmyzsh/zshrc ~/.zshrc |
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf
using homebrew.