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
// | |
// Все видео этого артиста | |
{% assign videos = artist.videos %} | |
// | |
// Все каналы с сайта вообще. К сожалению, нет способа забрать все | |
// каналы этого артиста, поэтому берем все и будем фильтровать. | |
{% assign channels = site.channels %} |
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
<!-- BEGIN .about --> | |
{% assign about = site|snippet_by_title:"about" %} | |
{{ about.body }} | |
<!-- END .about --> |
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
<div class="slider"> | |
<span class="slider__nav slider__prev"></span> | |
<span class="slider__nav slider__next"></span> | |
<div class="slider__items"> | |
{% assign index_banner_category = site|get_banner_category:"main" %} | |
{% assign banners = index_banner_category.banners %} | |
{% if banners != empty and banners != null %} | |
{% for banner in banners %} | |
<div> | |
<a href="{{ banner.url | absolute_url_filter }}"> |
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
# | |
# Using YML fixtures | |
# | |
# spec/fixtures/users.yml | |
admin: | |
id: 10 | |
login: administrator | |
is_admin: true |
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 | |
if RUBY_VERSION.to_f >= 1.9 | |
class String | |
def mb_chars | |
self.force_encoding(Encoding::UTF_8) | |
end | |
alias_method(:orig_concat, :concat) | |
def concat(value) |
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
window.confirm = function(p){ | |
var p = p || {}; | |
var wnd = new GUI.window({ | |
title: p.title || 'Подтверждение', | |
width: 400, | |
content: [{ | |
dom: $('<div class="GUI-alert-text">' + p.text + '</div>') | |
}], | |
footer: [new GUI.toolbarButton({ |
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
/** | |
* @author railsmaniac | |
* | |
* Сюда вынесен glue-код для заказчиков. | |
* Аналогично контроллеру в MVC. | |
*/ | |
/* | |
* Инициализирует структуру с кучей методов для работы с данными заказчиков |
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
module ActiveRecord | |
module ConnectionAdapters | |
class MysqlAdapter | |
def select(sql, name = nil) | |
@connection.query_with_result = true | |
result = execute(sql, name) | |
rows = result.all_hashes | |
result.free |
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
# Сохраняет OPENID идентификатор в сессию, если это возможно (если он есть в запросе) | |
# возвращает openid идентификатор. | |
# | |
def fetch_openid_identifier | |
if params.has_key?(:user_session) && params[:user_session].has_key?(:openid_identifier) | |
session[:openid_identifier] = params[:user_session][:openid_identifier].force_encoding('utf-8') | |
if session[:openid_identifier] =~ /(@yandex.ru|@ya.ru)$/ | |
session[:openid_identifier] = "http://openid.yandex.ru/#{session[:openid_identifier].split("@").first}/" | |
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
- (void) showPlot { | |
[[XNPlotManager sharedManager] startPlotting]; | |
XN2DPlot *plot = [[XN2DPlot alloc] initInRect:NSMakeRect(xRange.min, -5.0f, xRange.length, 10.0f) label:@"Plot" quality:40]; | |
[plot renderFunction:[XNFunction functionWithExpression:[textOriginalFunctionExpression stringValue]] range:xRange color:[NSColor blueColor] width:2]; | |
[[XNPlotManager sharedManager] endPlotting]; | |
} |