Skip to content

Instantly share code, notes, and snippets.

View itsNikolay's full-sized avatar
📈
Better then yesterday

Nikolay Ponomarev itsNikolay

📈
Better then yesterday
View GitHub Profile
Started PUT "/checkout/update/address" for 127.0.0.1 at 2012-12-16 15:51:24 +0400
Processing by Spree::CheckoutController#update as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"FiZb2TZaAXOUlqPpdEKXuWmpya7ushZavJ1VgQ3a3rk=", "order"=>{"bill_address_attributes"=>{"firstname"=>"Николай", "lastname"=>"Пономарев", "address1"=>"Ленина", "address2"=>"", "city"=>"Мурманск", "state_name"=>"Регионgfhdfh", "zipcode"=>"adsf", "country_id"=>"35", "phone"=>"adsf"}, "use_billing"=>"1"}, "button"=>"", "state"=>"address"}
Spree::Preference Exists (0.2ms) SELECT 1 AS one FROM "spree_preferences" WHERE "spree_preferences"."key" = 'spree/app_configuration/allow_ssl_in_development_and_test' LIMIT 1
Spree::Preference Load (0.2ms) SELECT "spree_preferences".* FROM "spree_preferences" WHERE "spree_preferences"."name" = 'allow_ssl_in_development_and_test' LIMIT 1
Spree::Order Load (0.3ms) SELECT "spree_orders".* FROM "spree_orders" WHERE "spree_orders"."id" = 1069267034 LIMIT 1
Spree::Adjustment Load (0.3ms) SE
@itsNikolay
itsNikolay / admin.js
Created December 12, 2012 08:50
фывафыва
// FIXME: Please fix this file, I don't like how it looks now at all.
// Request help from KODER if u don't know what to do.
$(document).ready(function() {
buttons_manipulation();
});
function buttons_manipulation() {
$(".accept-form-block").hide();
$(".decline-form-block").hide();
generate :scaffold, "admin/pages title slug:uniq:index description:text text:text published:boolean user:references"
gsub_file "db/migrate/*_create_admin_pages.rb", "t.boolean :published", "t.boolean :published, :default => false"
@itsNikolay
itsNikolay / test.rb
Created September 19, 2012 22:29
Install test
require 'bundler'
gem_group :development, :test do
gem 'rspec-rails', '2.10.0'
gem 'guard'
gem 'guard-rspec', '0.5.5'
gem 'rb-inotify', '0.8.8'
gem 'libnotify', '0.5.9'
gem 'guard-spork', '0.3.2'
gem 'spork', '0.9.0'
# template.rb
run "rm public/index.html"
generate(:scaffold, "person name:string")
route "map.root :controller => 'people'"
rake("db:migrate")
git :init
git :add => "."
git :commit => "-a -m 'Initial commit'"
Gems included by the bundle:
* actionmailer (3.2.8)
* actionpack (3.2.8)
* activemodel (3.2.8)
* activerecord (3.2.8)
* activeresource (3.2.8)
* activesupport (3.2.8)
* addressable (2.3.2)
* arel (3.0.2)
* bcrypt-ruby (3.0.1)
@itsNikolay
itsNikolay / spree_contries.yml
Created July 17, 2012 12:32
rake db:load_dir[default] # which containts followong files in folder mysite/db/default/**
countries_168:
name: "Российская Федерация"
iso3: RUS
iso: RU
iso_name: RUSSIAN FEDERATION
id: "168"
numcode: "643"
@itsNikolay
itsNikolay / deploy.rb
Created July 8, 2012 00:24 — forked from mikhailov/0. nginx_setup.sh
Nginx+Unicorn (production-ready setup)
# Capistrano configuration
#
# require 'new_relic/recipes' - Newrelic notification about deployment
# require 'capistrano/ext/multistage' - We use 2 deployment environment: staging and production.
# set :deploy_via, :remote_cache - fetch only latest changes during deployment
# set :normalize_asset_timestamps - no need to touch (date modification) every assets
# "deploy:web:disable" - traditional maintenance page (during DB migrations deployment)
# task :restart - Unicorn with preload_app should be reloaded by USR2+QUIT signals, not HUP
#app/helpers/spree/addresses_helper.rb
module Spree::AddressesHelper
def address_field(form, method, id_prefix = "b", &handler)
content_tag :p, :id => [id_prefix, method].join('_'), :class => "field" do
if handler
handler.call
else
is_required = Spree::Address.required_fields.include?(method)
separator = is_required ? '<span class="req">*</span><br />' : '<br />'
@itsNikolay
itsNikolay / address_decorator.rb
Created July 3, 2012 07:08 — forked from rozhok/address_decorator.rb
Remove billing address from Spree checkout page
Deface::Override.new(:name => "remove billing address form",
:virtual_path => "spree/checkout/_address",
:remove => "#billing[data-hook]"
)
Deface::Override.new(:name => "remove use billing address checkbox",
:virtual_path => "spree/checkout/_address",
:remove => "[data-hook='use_billing']"
)