Skip to content

Instantly share code, notes, and snippets.

View davinmsu's full-sized avatar
🐖
Thinking about old friends

Ivan Dashkevich davinmsu

🐖
Thinking about old friends
View GitHub Profile
if (!window.jQuery)
{
/*! jQuery v2.1.3 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.3",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this
(function() {
$(function() {
var $banner, closeBanner, initBanner, showBanner;
$banner = $('<div id="interactive-banner" />');
window.$banner = $banner;
$banner.stylesheet = $('<style type="text/css">#interactive-banner{position:fixed;top:0;left:0;width:100%;height:100%;display:none;background:#fff}#interactive-banner>.close{background: url("http://cdn.vmet.ro/html5_bnr/test/close.svg") no-repeat;background-size:contain;position:absolute;top:10px;right:10px;width:20px;height:20px}</style>');
$banner.closer = $('<div class="close" />');
$banner.content = $('<div class="content" />');
$('head').append($banner.stylesheet);
$banner.append($banner.closer, $banner.content).appendTo('body');
################################
### Классический REST запрос
################################
# запрос на получение объекта типа 'post' с уникальным идентификатором 123
'http://backend.url/posts/123'
# ответ, содержащий структурированную информацию по запросу:
# title - заголовок новости
@import 'normalize';
@import 'fonts';
@mixin clearfix {
&:after {
content: "";
display: table;
clear: both;
}
- offers.each do |offer|
.offer data-id="#{offer.id}" data-hidden="#{offer.hidden?}" data-url="#{offer.url if offer.mainBlockClickable?}"
.hidden-title = offer.hiddenTitle
.offer-type class="#{offer.type.class}" = t(offer.type.title)
// реализация интернационализации t()
.imgWrapper data-gallery="#{offer.gallery}" data-rotate="#{offer.rotate?}" data-video="#{offer.video.count if offer.video.exists?}"
.slider
- if offer.images.empty?
.no-image
- else
- offers.each do |offer|
.offer data-id="#{offer.id}" data-hidden="#{offer.hidden?}"
.hidden-title = offer.hiddenTitle
.offer-type class="#{offer.type.class}" = t(offer.type.title)
// реализация интернационализации t()
.imgWrapper data-gallery="#{offer.gallery}" data-rotate="#{offer.rotate?}" data-video="#{offer.video.count if offer.video.exists?}"
.slider
- if offer.images.empty?
.no-image
- else
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
module Spree
module Core
# THIS FILE SHOULD BE OVER-RIDDEN IN YOUR SITE EXTENSION!
# the exact code probably won't be useful, though you're welcome to modify and reuse
# the current contents are mainly for testing and documentation
# To override this file...
# 1) Make a copy of it in your sites local /lib/spree folder
# 2) Add it to the config load path, or require it in an initializer, e.g...
#
@davinmsu
davinmsu / main.css.scss
Created June 13, 2014 20:03
Гист для Жени
#sb {
display: block;
width: 200px;
height: 50px;
border-radius: 4px;
background: $blue;
text-decoration: none;
text-transform: uppercase;
font-family: 'Microsoft Sans Serif', Tahoma, Arial, Verdana, Sans-Serif;
border: 1px solid $blue;
h1 Мой блог
.posts
.post
time.teaser
/todo пофиксить на publish_date
p.date = @post.created_at.strftime('%d')
p.month = @post.created_at.strftime('%b')
= image_tag(@post.photos.first.content.url(:blog_index), class: 'teaser') unless @post.photos.empty?
h1 style="#{(@post.photos.empty?)? 'margin-left: 0px;' : ''}"
= link_to @post.title, user_post_path(user_id: @post.user_id, id: @post.id)