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 initFunction(){ | |
// Function that has to be called on document ready and after resize | |
}; | |
$(window).load(function () { | |
initFunction(); | |
var resizeTimer; | |
$(window).resize(function () { | |
clearTimeout(resizeTimer); |
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
isPad: function(){ | |
var touch = 'ontouchstart' in window; | |
var desktop = screen.width > 768 && !touch; | |
return !desktop; | |
} |
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="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Class naming</title> | |
</head> | |
<style> | |
/* LESS */ | |
.main-menu { |
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
jQuery(function($) { | |
"use strict"; | |
var $form = $('#chooseCarForm'), | |
$formContent = $('#chooseCarContent'), | |
$preloader = $("#chooseCarFormPreloader"), | |
updateUrl = $form.data('updateUrl'), | |
saveUrl = $form.attr('action'); | |
$form.on('change', 'select', function() { |
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 parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
function proml { | |
local BLUE="\[\033[0;34m\]" | |
local RED="\[\033[0;31m\]" | |
local YELLOW="\[\033[0;33m\]" | |
local LIGHT_RED="\[\033[1;31m\]" | |
local GREEN="\[\033[0;32m\]" |
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> | |
<head> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> | |
</head> | |
<body> | |
<!-- 1. The <iframe> (and video player) will replace this <div> tag. --> | |
<div id="player"></div> | |
<button id="playBtn">Play</button> |
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 () { | |
window.Vivaster = { | |
Youtube: {} | |
}; | |
window.onYouTubeIframeAPIReady = function () { | |
console.log(123); | |
Vivaster.Youtube.player = new YT.Player('player', { | |
height: '390', | |
width: '640', |
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.exports = function(grunt) { | |
require('load-grunt-tasks')(grunt); | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
shell: { // Task | |
bower_update: { // Target | |
options: { // Options | |
stderr: false | |
}, |
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
var MainView = Backbone.View.extend({ | |
el: $('.js-messagesMainView'), | |
events: { | |
'change .js-statusFilterInput': 'filter', | |
'click .js-checkboxFilterAll': 'filter' | |
}, | |
initialize: function() { | |
dialogsCollection.on('sync', function(e) { | |
console.log(e); | |
$('.preloader').hide(); |
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
<?php | |
/** | |
* Возвращает единицу измерения с правильным окончанием | |
* | |
* @param {Number} num Число | |
* @param {Object} cases Варианты слова {nom: 'час', gen: 'часа', plu: 'часов'} | |
* @return {String} | |
*/ | |
function units(num, cases) { | |
num = Math.abs(num); |
OlderNewer