This file contains hidden or 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
#= require hammerjs/dist/hammer.min | |
#= require jquery.hammer/jquery.hammer.min | |
$ -> | |
$(document).hammer() | |
$(document).on 'click', 'a', (e) -> e.preventDefault(); false | |
$(document).on 'tap', 'a', (e) -> window.location.href = e.currentTarget.href | |
This file contains hidden or 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
@for $i from 1 through 10 | |
blockquote | |
&:nth-of-type(#{$i}) | |
color: hsl(360/$i, 100%, 50%) | |
This file contains hidden or 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
<% predefined_colors = Settings.predefined_colors.map{ |k,v| "(#{k} #{v})" }.join(',') %> | |
@each $color in <%= predefined_colors %> | |
.segment-color-#{nth($color,1)} | |
background: nth($color,2) | |
&:hover | |
background: lighten(nth($color,2),3%) | |
This file contains hidden or 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 App.Views.SomeView extends Marionette.ItemView | |
template: JST['template'] | |
templateHelpers: -> Convead.Helpers.ApplicationHelpers |
This file contains hidden or 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
@import "compass/css3/transition"; | |
.btn-name { | |
@include transition( color 0.2s ease-in, background .2s ease-in ); | |
} | |
.btn-state-1 { | |
color: #000; | |
background: #eee; | |
} |
This file contains hidden or 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
source 'http://rubygems.org' | |
gem 'cocoapods', '>=0.17.0.rc5' |
This file contains hidden or 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
$ -> | |
submitByKey('.j-submit-by-key') | |
$ -> | |
messagesEl = $('.j-messages-list') | |
scrollToBottom messagesEl | |
$('#new_message_form') | |
.on 'ajax:success', (evt, data, status, xhr) -> | |
messagesEl.append xhr.responseText |
This file contains hidden or 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
# app/assets/javascripts/password-toggle.js.coffee | |
$ -> | |
$(".j-password-toggle").on "click", -> | |
icon = $(this).find("[class*='icon']") | |
icon.toggleClass('fontello-icon-eye') | |
icon.toggleClass('fontello-icon-eye-off') | |
input = $(this).closest('form').find('.j-password-input') | |
type = input.attr("type") | |
if type is "text" |
This file contains hidden or 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
// https://developers.google.com/speed/docs/best-practices/rtt#PutStylesBeforeScripts | |
!!! | |
%html | |
%head | |
... | |
// stylesheet loads first | |
= stylesheet_link_tag 'application' | |
// main javascript file is loaded in parallel with stylesheet | |
= javascript_include_tag 'application' |
This file contains hidden or 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 FormObjectBase < Hashie::Dash | |
extend ActiveModel::Naming | |
def persisted?; false; end | |
def to_key; nil; end | |
end | |
# Пример модели | |
class UserOrganizationForm < FormObjectBase |