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
// Этот скрипт должен быть размещён в <head> над всеми внешними объявлениями стилей (link[rel=stylesheet]) | |
function loadFont(fontName, woffUrl, woff2Url) { | |
// 0. Многие неподдерживаемые браузеры должны останавливать работу тут. | |
var nua = navigator.userAgent; | |
var noSupport = !window.addEventListener // IE8 и ниже | |
|| (nua.match(/(Android (2|3|4.0|4.1|4.2|4.3))|(Opera (Mini|Mobi))/) && !nua.match(/Chrome/)) // Android Stock Browser до 4.4 и Opera Mini | |
if (noSupport) { | |
return; | |
} |
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
# vim:ft=zsh ts=2 sw=2 sts=2 | |
# | |
# Based on Agnoster's Theme — https://gist.github.com/3712874 | |
# A Powerline-inspired theme for ZSH | |
# | |
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts) | |
# [Solarized theme](https://github.com/altercation/solarized/) | |
# [iTerm 2](http://www.iterm2.com/) | |
### Segment drawing |
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
table { display: table } | |
tr { display: table-row } | |
thead { display: table-header-group } | |
tbody { display: table-row-group } | |
tfoot { display: table-footer-group } | |
col { display: table-column } | |
colgroup { display: table-column-group } | |
td, th { display: table-cell } | |
caption { display: table-caption } |
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
.element { | |
position: relative; | |
top: 50%; | |
transform: translateY(-50%); | |
} |
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
/** | |
* 1. Переопределяет свойство `appearance`, заменяет `searchfield` в Safari и Chrome. | |
* 2. Переопределяет свойство `box-sizing`, заменяет `border-box` в Safari и Chrome. | |
*/ | |
input[type="search"] { | |
-webkit-appearance: textfield; /* 1 */ | |
box-sizing: content-box; /* 2 */ | |
} |
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
input:valid { | |
border-color: green; | |
} | |
input:invalid { | |
border-color: red; | |
} |
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
// All elements which match this will be syntax highlighted. | |
var selector = 'code'; | |
var keywords = ('var function if else for while break switch case do new ' | |
+'continue delete return this true false throw catch typeof').split(' '); | |
// Syntax definition | |
// The key becomes the class name of the <span> | |
// around the matched block of code. | |
var syntax = { |
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
if (navigator.geolocation) { | |
// #showroute это id кнопки/ссылки на сайте, нажимая которую мы должны проложить маршрут | |
var showroute = document.getElementById('showroute'); | |
showroute.addEventListener('click', function(event) { | |
event.preventDefaults(); | |
// пока строится маршрут не разрешаем нажимать на кнопку/ссылку снова | |
if (!showroute.classList.contains('disabled')) { | |
showroute.classList.add('disabled'); |
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
Tumblr = require('tumblr').Tumblr | |
blog = new Tumblr 'simonenko.tumblr.com', 'OAuth Consumer Key' | |
blog.text limit: 2, (error, response) -> | |
throw new Error error if error | |
console.log response.posts | |
blog.link limit: 10, tag: "javascript", (error, response) -> | |
throw new Error error if error |
NewerOlder