Skip to content

Instantly share code, notes, and snippets.

@zogreptile
zogreptile / favicon.html
Last active August 2, 2017 06:03
Favicon meta tags
<link rel="apple-touch-icon" sizes="180x180" href="favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" href="favicon/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="favicon/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="favicon/manifest.json">
<link rel="mask-icon" href="favicon/safari-pinned-tab.svg" color="#2ac394">
<meta name="msapplication-TileColor" content="#2ac394">
<meta name="msapplication-TileImage" content="favicon/mstile-150x150.png">
<meta name="msapplication-config" content="favicon/browserconfig.xml" />
@zogreptile
zogreptile / Input-type-number.css
Created August 30, 2017 02:19
Input type="number" arrow reset
input {
-moz-appearance:textfield;
&::-webkit-outer-spin-button,
&::-webkit-inner-spin-button {
-webkit-appearance: none;
}
}
@zogreptile
zogreptile / mobile-user-agent-check.js
Created September 26, 2017 04:00
Check if user agent is mobile
function isMobile() {
if (
navigator.userAgent.match(/Android/i) ||
navigator.userAgent.match(/webOS/i) ||
navigator.userAgent.match(/iPhone/i) ||
navigator.userAgent.match(/iPad/i) ||
navigator.userAgent.match(/iPod/i) ||
navigator.userAgent.match(/BlackBerry/i) ||
navigator.userAgent.match(/Windows Phone/i)
) {
В переменные среды добавить CMDER_ROOT: <путь к папке cmder>
{
"workbench.colorTheme": "Ayu Mirage",
"workbench.iconTheme": "ayu",
"extensions.ignoreRecommendations": false,
"window.zoomLevel": 0,
"terminal.integrated.shellArgs.windows": [
"cmd /k",
"%CMDER_ROOT%\\vendor\\init.bat"
@zogreptile
zogreptile / ya-map.js
Last active March 21, 2018 23:52
Несколько объектов на яндекс карте. Позиционирование метки.
ymaps.ready(init);
var myMap,
myPlacemark;
var places = [
{
name: 'Точка № 1',
lat: 48.471125,
long: 135.058703
},
@zogreptile
zogreptile / prevent-selection.css
Last active April 2, 2018 12:12
Запретить выделение.
-webkit-user-select: none; /* Chrome/Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+ */
@zogreptile
zogreptile / retina-media.css
Last active May 8, 2018 11:13
Детект ретины.
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and ( min-device-pixel-ratio: 2),
only screen and ( min-resolution: 192dpi),
only screen and ( min-resolution: 2dppx) {
}
$('#slider')
.on('init', function () {
$(this).removeClass('slider--before-init');
})
.slick({
arrows: false,
autoplay: true,
autoplaySpeed: 5000,
infinite: true,
speed: 300,
@zogreptile
zogreptile / column-count.css
Created April 10, 2018 23:43
Запрет переноса для column-count.
.parent {
column-count: 3;
}
.child {
break-inside: avoid-column;
}
@zogreptile
zogreptile / yamap-geocode.js
Created April 19, 2018 07:09
Метка на яндекс карте по геокодеру.
ymaps.ready(function () {
var geocoder = ymaps.geocode("{{ object_item.address }}", {result: 1});
geocoder.then(
function (res) {
var point = res.geoObjects.get(0),
mapCenter = point.geometry.getCoordinates();
var map = new ymaps.Map('map', {
center: mapCenter,