Skip to content

Instantly share code, notes, and snippets.

from bash:
createdb presentation
psql presentation
in psql:
CREATE table people(id serial, last_name text, first_name text, age integer);
~/src/sherrylehmann/sl-web$: git remote show origin
* remote origin
Fetch URL: git@github.com:sherrylehmann/sl-web.git
Push URL: git@github.com:sherrylehmann/sl-web.git
HEAD branch: master
Remote branch:
master tracked
Local branch configured for 'git pull':
master rebases onto remote master
Local ref configured for 'git push':
module Spree::Core::Search
Base.class_eval do
def method_missing(name,*args,&block)
@properties[name]
end
end
class SpreeSunspot < defined?(Spree::Search::MultiDomain) ? Spree::Search::MultiDomain : Spree::Core::Search::Base
module Spree
Product.class_eval do
searchable do
PRODUCT_OPTION_FACETS.each do |option|
string "#{option}_facet", :multiple => true do
get_option_values(option.to_s).map(&:presentation)
end
end
PRODUCT_PROPERTY_FACETS.each do |prop|
gem install 'ruby_odata'
require 'ruby_odata'
svc = OData::Service.new("https://data.shipstation.com/1.2", username: 'jeff.squires@gmail.com', password: 'see_email_for_real_password')
svc.Orders.filter("OrderNumber eq 'R727282485'").expand("OrderItems")
order = svc.execute.first
gem install 'ruby_odata'
require 'ruby_odata'
svc = OData::Service.new("https://data.shipstation.com/1.2", username: 'jeff.squires@gmail.com', password: 'see_email_for_real_password')
svc.Orders.filter("OrderNumber eq 'R727282485'").expand("OrderItems")
order = svc.execute.first
~/src/genosha$: be cap prestaging deploy
triggering load callbacks
* 2013-06-03 19:41:23 executing `prestaging'
triggering start callbacks for `deploy'
* 2013-06-03 19:41:23 executing `multistage:ensure'
* 2013-06-03 19:41:23 executing `deploy'
* 2013-06-03 19:41:23 executing `deploy:update'
** transaction: start
* 2013-06-03 19:41:23 executing `deploy:update_code'
updating the cached checkout on all servers
~/src/landlord/spec/dummy$: RAILS_ENV=production bundle exec rake --trace assets:precompile:primary
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
locations = CampLocation.unscoped.where("name like '%ustin%'")
location_option_values = []
locations.each do |location|
begin
location_option_values << Spree::OptionValue.unscoped.find(location.location_option_value_id)
rescue => error
puts "trouble with location: #{location.id} - #{location.name} - #{error}"
end
end
with(:price, Range.new(price.split('-').first, price.split('-').last)) if price
# see https://github.com/sunspot/sunspot#readme for a good explanation of using 'row' with facets
facet(:price) do
PRODUCT_PRICE_RANGES.each do |range|
row(range) do
Rails.logger.debug("adding price facet w/ range: #{range.split('-').first}, #{range.split('-').last}")
with(:price, Range.new(range.split('-').first, range.split('-').last))
end
end