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
source 'https://rubygems.org'
gem 'rails', '3.2.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'spree', '1.1.0'
worker_processes 1;
events {
worker_connections 1024;
}
http {
passenger_root /home/me/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12;
passenger_ruby /home/me/.rvm/wrappers/ruby-1.9.3-p194/ruby;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
@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']"
)
#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 / 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
@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"
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)
# 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'"
@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'