This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bash: | |
createdb presentation | |
psql presentation | |
in psql: | |
CREATE table people(id serial, last_name text, first_name text, age integer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/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': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder