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
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), | |
only screen and (min-resolution: 144dpi) { ... } |
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
/* Синхронизация */ | |
git checkout gh-pages | |
git rebase master | |
git push origin gh-pages | |
git checkout master | |
/* Deploy из папки dist */ | |
git subtree push --prefix dist origin gh-pages |
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
{ | |
"name": "npm-tasks-boilerplate", | |
"version": "0.0.1", | |
"description": "", | |
"author": "Monochromer <monochromer@mail.ru>", | |
"scripts": { | |
"clean": "rm -rf build/", | |
"server": "browser-sync start --server \"build\" --files 'build/**/*.*' --directory", | |
"stylus": "stylus src/styles/main.styl -o build/css --include-css", | |
"prefix": "postcss -u autoprefixer --autoprefixer.browsers \"> 1%\" -r build/css/*", |
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(Element) { | |
// matches polyfill | |
if (!Element.prototype.matches) { | |
Element.prototype.matches = Element.prototype.matchesSelector || | |
Element.prototype.webkitMatchesSelector || | |
Element.prototype.mozMatchesSelector || | |
Element.prototype.msMatchesSelector || | |
function matches(selector) { |
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
// https://github.com/pazguille/decouple/ | |
// Decouple the DOM events from expensive functions. | |
// https://www.html5rocks.com/en/tutorials/speed/animations | |
function decouple(node, event, fn) { | |
var eventData, | |
tracking = false; | |
function captureEvent(e) { | |
eventData = e; |
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(global, utils) { | |
utils.namespace = function(namespace, closure) { | |
closure.call( | |
null, | |
namespace | |
.split('.') | |
.reduce( | |
function(parent, current, index, keys) { | |
if(!parent.hasOwnProperty(current)) parent[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
png | |
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAMAAAAoyzS7AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII= | |
gif | |
data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 |
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
let fontFace = new FontFace("MyWebFont", "url('MyWebFont.woff2') format('woff2'), url('MyWebFont.woff') format('woff')"); | |
fontFace.load().then(function(loadedFontFace) { | |
document.fonts.add(loadedFontFace); | |
document.getElementById("target").style.fontFamily = "MyWebFont"; | |
}); |
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
// выпадающий список со статусами | |
UI.commonFuncs.statusSelect = function () { | |
var selectSelector = 'select.select-status'; | |
var $selects = $(selectSelector); | |
console.log($selects); | |
if (!$selects.length) return; | |
var template = [ |
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 slice = Function | |
.prototype | |
.call | |
.bind(Array.prototype.slice); | |
var args = slice(arguments); | |
// Пример | |
// http://davidshariff.com/blog/borrowing-methods-in-javascript/ |