Skip to content

Instantly share code, notes, and snippets.

View foxweb's full-sized avatar
🏠
Working from home

Aleksey Kurepin foxweb

🏠
Working from home
View GitHub Profile
a = [1, 3, 5, 7, 9, 11, 13, 15]; a.each{|x| puts "x = #{x}"; a.each{|y| puts "y = #{y}"; a.each{|z| puts "#{x} + #{y} + #{z} = #{x+y+z}" } } }
ru:
spree:
master: Master
prices: Цены
show_currency_selector: Показывать переключатель валюты
supported_currencies: Поддерживаемые валюты
allow_currency_change: Разрешить смену валюты
variant_prices_search_placeholder: Искать по коду SKU или названию
notice:
prices_saved: Цены успешно сохранены
class PostsController < ApplicationController
# GET /posts
# GET /posts.xml
def index
@posts = Post.find(:all)
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @posts }
end
function checkRequiredPayments() {
$('input.payment_sum_field').each(function() {
if ($(this).hasClass("required")) {
var tr = $(this).parents("tr");
var checkbox = $("input[type=checkbox]:first", tr);
if (!checkbox.attr("checked")) {
checkbox.attr("checked", true);
}
var re = new RegExp("r_([0-9]+)");
var week_days = ['', 'понедельникам','вторниками','средам','четвергам','пятницам','субботам','воскресеньям'];
nsMain.OrderForm = Ext.extend(Ext.form.FormPanel, {
initComponent: function(){
var old_delivery_type;
var old_delivery_city;
var old_delivery_country;
var old_delivery_metro;
Ext.apply(this, {
url: '/office/server/callcenter/server.php',
if defined?(Object::RedCloth) and (!RedCloth.instance_methods.include?(:stock_pgl))
# RuTils выполняет перегрузку Textile Glyphs в RedCloth, перенося форматирование спецсимволов на Gilenson.
class ::Object::RedCloth < String #:nodoc:
# Этот метод в RedCloth при наличии Гиленсона надо отключать
alias_method :stock_htmlesc, :htmlesc
def htmlesc(text, mode=0) #:nodoc:
RuTils::overrides_enabled? ? text : stock_htmlesc(text, mode)
end
if defined?(Object::RedCloth) and (!RedCloth.instance_methods.include?(:stock_pgl))
# RuTils выполняет перегрузку Textile Glyphs в RedCloth, перенося форматирование спецсимволов на Gilenson.
class Object::RedCloth < String #:nodoc:
# Этот метод в RedCloth при наличии Гиленсона надо отключать
alias_method :stock_htmlesc, :htmlesc
def htmlesc(text, mode=0) #:nodoc:
RuTils::overrides_enabled? ? text : stock_htmlesc(text, mode)
end
class CreateVisaforms < ActiveRecord::Migration
def self.up
create_table :visaforms do |t|
t.string :lastname #1
t.string :lastname_prev #2
t.string :firstname #3
t.date :birth_date #4
t.string :birth_place #5
t.string :birth_country #6
@foxweb
foxweb / gist:713493
Created November 24, 2010 11:04
show.html.erb
<p id="notice"><%= notice %></p>
<p>
<b>Lastname:</b>
<%= @request.lastname %>
</p>
<p>
<b>Lastname prev:</b>
<%= @request.lastname_prev %>
class Request < ActiveRecord::Base
validates_length_of :lastname, :minimum => 2
validates_length_of :lastname_prev, :minimum => 2, :allow_blank => true
validates_length_of :firstname, :minimum => 2
belongs_to :birth_country_rel, :class_name => 'Country', :foreign_key => :birth_country
belongs_to :national_rel, :class_name => 'Country', :foreign_key => :national
belongs_to :birth_national_rel, :class_name => 'Country', :foreign_key => :birth_national
belongs_to :country_start_rel, :class_name => 'Country', :foreign_key => :country_start
belongs_to :country_dest_rel, :class_name => 'Country', :foreign_key => :country_dest
end