Skip to content

Instantly share code, notes, and snippets.

@kovaldn
kovaldn / Javascript: date.js
Last active December 24, 2015 17:49
Javascript: date
/*work with Date*/
/*
* DATA.JS
* https://code.google.com/p/datejs/wiki/APIDocumentation#between
* http://www.datejs.com/
*/
Date.today();
@kovaldn
kovaldn / Javascript: patterns - object literal, module.js
Last active December 17, 2015 10:59
Javascript: patterns - object literal, module
/*
* Architecture - Object Literal
* Advantages:
* - Easer to navigate and discuss
* - Profilers give you actual names to work with
* - You can execute these from firebug console
* - You can write unit tests against them
*/
@kovaldn
kovaldn / Javascript: backbone.js
Last active December 24, 2015 17:49
Javascript: backbone
/*
* BACKBONE
*/
// VIEW
define([
'jquery',
'backbone',
'text!..template.php'
@kovaldn
kovaldn / IE: firebug lite.js
Last active December 17, 2015 12:39
IE: firebug lite
<script type="text/javascript" src="https://getfirebug.com/firebug-lite.js"></script>
@kovaldn
kovaldn / Javascript: PATTERNS.js
Last active December 17, 2015 12:39
Javascript: PATTERNS
/*
* PATTERNS
*/
// Singleton
var Singleton = new function() {
var single = this;
@kovaldn
kovaldn / Javascript: switch.js
Last active December 17, 2015 12:48
Javascript: switch
var a = 2 + 2;
switch (a) {
case 4:
alert('Верно!');
break;
case 3:
case 5:
alert('Неверно!');
@kovaldn
kovaldn / Javascript: Deferreds.js
Last active December 17, 2015 13:49
Javascript: Deferreds
/*
* ---------------------
* Deferreds
* ---------------------
*/
// What the heck is a deferred object?
// - A Deferred is a state storage object - 'pending' or 'resolved | rejected'
var def = $.Deferred(); //def.state() === 'pending'
@kovaldn
kovaldn / Javascript: matchMedia, modernizr.js
Last active December 17, 2015 14:49
Javascript: matchMedia, modernizr
/*
* MATCHMEDIA API
* info:
* http://loftblog.ru/2013/05/22/izuchaem-matchmedia-api-i-object-mediaquerylist/#more-686
* http://dbaron.org/log/20110422-matchMedia
* http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface
* browser support polyfill:
* https://github.com/weblinc/media-match
*/
@kovaldn
kovaldn / CSS: font-face.css
Last active April 8, 2020 17:58
CSS: font-face
@font-face {
font-family: 'bebas';
src: url('../fonts/firasans-book.eot');
src: url('../fonts/firasans-book.eot?#iefix') format('eot'),
url('../fonts/firasans-book.woff') format('woff'),
url('../fonts/bebas.ttf') format('truetype'),
url('../fonts/firasans-book.svg#svgFirasans-book') format('svg');
font-weight: normal;
font-style: normal;
}
@kovaldn
kovaldn / HTML: symbols.html
Last active April 8, 2020 17:58
HTML: symbols
&copy; - спецсимвол для значка копирайтов
&laquo; - кавычки красивые
&nbsp; - пробел