Skip to content

Instantly share code, notes, and snippets.

View gorborukov's full-sized avatar

Evgeny gorborukov

  • Krasnodar
View GitHub Profile
@gorborukov
gorborukov / gist:32d934fbb10458d2c399
Last active August 29, 2015 14:10
show/hide fields by radio button click
.child-options, #childAge1, #childAge2, #childAge3, #childAge4, #childAge5 {
display: none;
}
<input type="radio" name="inlineRadioOptions" id="child1" value="option1"> 1
...
<input type="radio" name="inlineRadioOptions" id="child5" value="option5"> 5
@gorborukov
gorborukov / gist:45d13c4b10d8e3bbd4fa
Created October 29, 2014 22:09
riviera-sochi.ru forecast
Погода на сегодня:
<ul class="forecast"></ul>
<script>
var yqlCallback = function(data) {
var resorts = ["Сочи", "Красная Поляна", "Анапа", "Геленджик"]
for (var i = 0; i < 4; i++) {
$("ul.forecast").append("<li><a href=\"\">" + "<b>" + resorts[i] + " </b>" + data.query.results.channel[i].item.condition.temp + "&deg;" + " C" + "</a></li>")
}
};
@gorborukov
gorborukov / autocar
Last active August 29, 2015 14:07
Бетононасосы
Репозиторий https://github.com/gorborukov/autocar – создаем пустой проект и делаем пуш в ветку мастер, далее каждую задачу в отдельную ветку и по окончании задачи делаешь пул реквест http://ivan.rolik.name/2013/01/29/pull-request-without-fork-github/.
Разделы сайта:
Главная
Каталог
- Бетононасосы
- Подкатегории бетононасосов
- Товар отдельно
= form_for(@content) do |f|
- if @content.errors.any?
#error_explanation
%h2
= pluralize(@content.errors.count, "error")
prohibited this content from being saved:
%ul
- @content.errors.full_messages.each do |msg|
%li= msg
.form-group
# заменяем в /app/views/common/_header.html.erb
<h1>
<%= link_to image_tag('/img/logo.png', :alt => 'Морской квартал'), root_path, :title => 'Морской квартал', :remote => true %>
</h1>
на
<h1 class="logo">
<%= link_to image_tag('/img/logo.png', :alt => 'Морской квартал'), root_path, :title => 'Морской квартал', :remote => true, :class => 'logo-main' %>
<%= link_to image_tag('/img/printlogo.png', :alt => 'Морской квартал'), root_path, :title => 'Морской квартал', :remote => true, :class => 'logo-printable' %>
@gorborukov
gorborukov / apartments_controller.rb
Last active August 29, 2015 14:01
/app/controllers/apartments_controller.rb & /app/views/layouts/print.html.erb & /app/config/routes.rb & /app/views/apartments/printable.html.erb
class ApartmentsController < ApplicationController
layout :choose_layout
def show
@building = Building.find params[:building_id]
@apartment = @building.apartments.find params[:id]
end
def printable
@building = Building.find params[:building_id]
@apartment = params[:apartment_id]
@gorborukov
gorborukov / print.css
Created May 28, 2014 14:57
/app/assets/stylesheets/morskoy/print.css
@media print {
* {
background: transparent !important;
color: #333 !important; /* Black prints faster: h5bp.com/s */
box-shadow: none !important;
text-shadow: none !important;
}
a,
a:visited {
- meta :title => @tour.seo_title,
- :description => @tour.seo_description,
- :keywords => @tour.seo_keywords
.content
.tour_column
.tour_block
.blue
%h3
Тур «#{@tour.name}»
.resort
!!!
%html
%head
= metamagic :title, :description, :keywords
= stylesheet_link_tag "application", :media => "all"
= javascript_include_tag "application"
= csrf_meta_tags
%body
.update-message
.container
@gorborukov
gorborukov / gist:9757604
Created March 25, 2014 08:53
Unicorn Azure
# Sample verbose configuration file for Unicorn (not Rack)
#
# This configuration file documents many features of Unicorn
# that may not be needed for some applications. See
# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb
# for a much simpler configuration file.
#
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
# documentation.