Skip to content

Instantly share code, notes, and snippets.

View FineLineAutomation's full-sized avatar

Fine Line Automation FineLineAutomation

View GitHub Profile
;(function ($, window, document, undefined) {
'use strict';
Foundation.libs.reveal = {
name : 'reveal',
version : '{{VERSION}}',
locked : false,
@FineLineAutomation
FineLineAutomation / postgres.rb
Last active August 29, 2015 14:07
postgres.rb
Capistrano::Configuration.instance.load do
set :postgresql_host, "localhost"
set(:postgresql_user) { application }
set(:postgresql_password) { Capistrano::CLI.password_prompt "PostgreSQL Password: " }
set(:postgresql_database) { "#{application}_production" }
set(:postgresql_dump_path) { "#{current_path}/tmp" }
set(:postgresql_dump_file) { "#{application}_dump.sql" }
set(:postgresql_local_dump_path) { File.join(Dir.pwd, "tmp") }
set(:postgresql_pid) { "/var/run/postgresql/9.1-main.pid" }
@FineLineAutomation
FineLineAutomation / gist:8985621
Created February 13, 2014 22:53
Paypal IPN notes
IPN & eCheck Support
eCheck payments are now fully supported and PayPal's Instant Payment Notification service is also supported for receiving updates relating to eCheck payments only. To configure eCheck payments you'll need to:
1. Configure your PayPal account to accept eCheck payments (under Profile on PayPal's website).
2. Set the IPN URL on your PayPal account (under Profile on PayPal's website) to:
https://www.yourstore.com/paypal_notify
3. Enable auto_capture within Spree (as eCheck payments are only supported for purchase and not authorize requests).
Spree::Config.set(:auto_capture => true)
@FineLineAutomation
FineLineAutomation / application.rb
Last active August 29, 2015 13:56
Scoping based on whether we are in spree's admin backend or not.
#Make sure this appears somewhere in your application.rb file.
config.to_prepare do
# Load application's model / class decorators
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
Rails.configuration.cache_classes ? require(c) : load(c)
end
# Load application's view overrides
Dir.glob(File.join(File.dirname(__FILE__), "../app/overrides/*.rb")) do |c|
# link to cart better
Spree::BaseHelper.module_eval do
def taxons_tree(root_taxon, current_taxon, max_level = 1, root_css_class = nil)
return '' if max_level < 1 || root_taxon.children.empty?
content_tag :ul, :class => root_css_class do
root_taxon.children.map do |taxon|
css_class = (taxon.children.empty? || max_level < 2) ? "no_sub_menu" : "has_sub_menu"
i_class = (css_class == "no_sub_menu") ? "fi-minus" : "fi-plus"
content_tag :li, :class => css_class do
Nathans-iMac:spree_editor nate$ bundle exec rake test_app
Generating dummy Rails application...
rake aborted!
uninitialized constant RSpec::Matchers
/Users/nate/Projects/Websites/spree_editor/spec/dummy/config/application.rb:5:in `<top (required)>'
/Users/nate/Projects/Websites/spree_editor/spec/dummy/Rakefile:4:in `require'
/Users/nate/Projects/Websites/spree_editor/spec/dummy/Rakefile:4:in `<top (required)>'
/Users/nate/.rvm/gems/ruby-1.9.3-p286@global/bin/ruby_noexec_wrapper:14:in `eval'
/Users/nate/.rvm/gems/ruby-1.9.3-p286@global/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)
== MigrateOldShippingCalculators: migrating ==================================
rake aborted!
An error has occurred, this and all later migrations canceled:
The single-table inheritance mechanism failed to locate the subclass: 'Spree::Calculator::Ups::ThreeDaySelect'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Spree::Calculator.inheritance_column to use another column for that information./Users/nate/Projects/Websites/spree-fine-line-automation/db/migrate/20131215195190_migrate_old_shipping_calculators.spree.rb:5:in `block in up'
/Users/nate/Projects/Websites/spree-fine-line-automation/db/migrate/20131215195190_migrate_old_shipping_calculators.spree.rb:4:in `each'
/Users/nate/Projects/Websites/spree-fine-line-automation/db/migrate/20131215195190_migrate_old_shipping_calculators.spree.rb:4:in `up'
/Users/nate/.rvm/gems/ruby-1.9.3-p286@global/
# This is what is currently in app/controllers/admin/orders_controller
before_filter :load_order, :only => [:show, :edit, :update, :fire, :resend]
# I want to add the print action to the filter.
# In my controller decorater, I have the below line
before_filter :load_order, :only => [:show, :edit, :update, :fire, :resend, :print]
# I am worried that redefining the filter will cause problems with extensions.
# Is there a syntax I can use to just add the print action to the filter?