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
# Find products with longest names | |
Product.all.collect{ |p| p.name }.max_by(&:length) |
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
$(function() { | |
$('#project1').on('click', function() { | |
$('#projectsWrapper').css('margin-left', '0'); | |
$('#circlesWrapper li').removeClass('current'); | |
$(this).addClass('current'); | |
}); | |
$('#project2').on('click', function() { | |
$('#projectsWrapper').css('margin-left', '-100vw'); | |
$('#circlesWrapper li').removeClass('current'); | |
$(this).addClass('current'); |
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
# encoding: utf-8 | |
class ApplicationUploader < CarrierWave::Uploader::Base | |
# include CarrierWave::RMagick | |
include CarrierWave::MiniMagick | |
include CarrierWave::MimeTypes | |
include Sprockets::Helpers::RailsHelper | |
include Sprockets::Helpers::IsolatedHelper |
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
class Tagging < ActsAsTaggableOn::Tagging | |
scope :publication_tags, where(context: 'publication_tags') | |
scope :places, where(context: 'places') | |
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
@tags = () -> | |
$.getJSON '/taggings/publication_tags', (json) => | |
$('.select2-input#publicationTags').select2({tags: json, width: '608px', containerCssClass: 'tagsInput', dropdownCssClass: 'tagsDropdown'}) | |
@places = () -> | |
$.getJSON '/taggings/places', (json) => | |
$('.select2-input#publication_place_list').select2({tags: json, width: '608px', containerCssClass: 'placeInput', dropdownCssClass: 'placesDropdown', maximumSelectionSize: 1, openOnEnter: false}) | |
$ -> | |
tags() |
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
<a href="#identifier">Go to element with an ID</a> | |
<div id="identifier">Element to go to</div> |
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
class Ability | |
include CanCan::Ability | |
def initialize(user) | |
user ||= User.new # guest user | |
admins = ['superadmin', 'admin'] | |
redactors = ['superadmin', 'admin', 'redactor'] | |
authors = ['superadmin', 'admin', 'redactor', 'author'] | |
civils = [ 'author', 'user'] |
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
h1, h2, h3 { | |
font-weight: bold; | |
letter-spacing: -0.1px; | |
} | |
h1 { | |
margin-top: 213px; | |
font-size: 60px; | |
text-align: center; | |
letter-spacing: -2.4px; |
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
<!DOCTYPE html> | |
<html lang="ru"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Дом Наркомфина</title> | |
</head> | |
<body> | |
<h1>Дом Наркомфина</h1> | |
<p>Дом Наркомфина — жилой дом переходного типа, построенный в <a href="https://ru.wikipedia.org/wiki/1930_%D0%B3%D0%BE%D0%B4">1930 году</a> по проекту архитекторов <a href="https://ru.wikipedia.org/wiki/%D0%93%D0%B8%D0%BD%D0%B7%D0%B1%D1%83%D1%80%D0%B3,_%D0%9C%D0%BE%D0%B8%D1%81%D0%B5%D0%B9_%D0%AF%D0%BA%D0%BE%D0%B2%D0%BB%D0%B5%D0%B2%D0%B8%D1%87">Моисея Гинзбурга</a> и <a href="https://ru.wikipedia.org/wiki/%D0%9C%D0%B8%D0%BB%D0%B8%D0%BD%D0%B8%D1%81,_%D0%98%D0%B3%D0%BD%D0%B0%D1%82%D0%B8%D0%B9_%D0%A4%D1%80%D0%B0%D0%BD%D1%86%D0%B5%D0%B2%D0%B8%D1%87">Игнатия Милиниса</a> для работников <a href="https://ru.wikipedia.org/wiki/%D0%9D%D0%B0%D1%80%D0%BE%D0%B4%D0%BD%D1%8B%D0%B9_%D0%BA%D0%BE%D0%BC%D0%B8%D1%81%D1%81%D0%B0%D1%80%D0%B8%D0%B0%D1%82_%D1%84%D0%B8%D0%BD%D0%B0%D0%BD%D1%81%D0%BE%D0%B2">Народного комиссариата финансов СССР (Наркомфина)</a>. Находится в Москве на <a href="https |