Skip to content

Instantly share code, notes, and snippets.

@aalexeev239
aalexeev239 / mkfavicon.sh
Last active August 29, 2015 14:11 — forked from pfig/mkfavicon.sh
#!/bin/bash
# from
# http://bergamini.org/computers/creating-favicon.ico-icon-files-with-imagemagick-convert.html
convert source-WxW.png -resize 256x256 -transparent white favicon-256.png
convert favicon-256.png -resize 16x16 favicon-16.png
convert favicon-256.png -resize 32x32 favicon-32.png
convert favicon-256.png -resize 64x64 favicon-64.png
convert favicon-256.png -resize 128x128 favicon-128.png
@aalexeev239
aalexeev239 / gist:30b7d77987a0ff31061f
Created March 8, 2015 13:20
hover-state / LESS / Sublime Text 3
<snippet>
<content><![CDATA[
&:hover {
${1}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>hvr</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.less</scope>
@aalexeev239
aalexeev239 / gist:a943fd66b7ade6c376ee
Created March 8, 2015 13:21
first-child-state / LESS / Sublime Text 3
<snippet>
<content><![CDATA[
&:first-child {
${1}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>fch</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.less</scope>
@aalexeev239
aalexeev239 / type.html
Last active September 20, 2022 13:54
typography page
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Title</title>
<link rel="stylesheet" href="css/style.css">
</head>
/*****************************************************************
*
* Copy Layer text 1.0 - by Praveen Vijayan! - http://www.decodize.com/
*
* Compatibility above Photoshop CS6
*
* Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
*
*****************************************************************/
@aalexeev239
aalexeev239 / markup.html
Created August 6, 2015 23:07
---- hipsta header ----
<h1>Heading</h1>
<h1>This is a longer heading</h1>
@aalexeev239
aalexeev239 / preventImageLoading.html
Last active September 17, 2015 23:10
prevent image loading for mobile
<!--The idea is to load base64-encoded 1px transparent gif for some media queries-->
<picture>
<source media="(max-width: 759px)" srcset="data:image/gifbase64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==">
<img src="image.png" srcset="image@2x.png 2x, image@3x.png 3x" height="100" width="100" alt="image">
</picture>
<picture>
<source srcset="{{img}}" media="(min-width: 768px)" />
<img srcset="data:image/gifbase64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="{{title}}" width="110" height="110" />
</picture>
@aalexeev239
aalexeev239 / rusPluralize.js
Created August 30, 2015 17:47
Pluralize russian nouns
/**
* http://habrahabr.ru/post/105428/
* Функция возвращает окончание для множественного числа слова на основании числа и массива окончаний
* @param iNumber Integer Число на основе которого нужно сформировать окончание
* @param aEndings Array Массив слов или окончаний для чисел (1, 4, 5),
* например ['яблоко', 'яблока', 'яблок']
* @return String
*/
function getNumEnding(iNumber, aEndings)
{
@aalexeev239
aalexeev239 / media.styl
Last active February 10, 2024 07:12
stylus media breakpoints and visibility classes
$breakpoint = {
tablet : 640px,
laptop : 1000px,
desk : 1260px,
large : 1600px
}
$media = {
mobile : "(max-width: "+unit(($breakpoint.tablet - 1), 'px')+")",
tablet : "(min-width: "+unit($breakpoint.tablet, 'px')+") and (max-width: "+unit(($breakpoint.laptop - 1), 'px')+")",
// @2x Images (Pixel Ratio of 1.25+)
$retina2x = "only screen and (-o-min-device-pixel-ratio: 5/4), only screen and (-webkit-min-device-pixel-ratio: 1.25), only screen and (min-device-pixel-ratio: 1.25), only screen and (min-resolution: 1.25dppx)"
// @3x Images (Pixel Ratio of 2.25+)
$retina3x = "only screen and (-o-min-device-pixel-ratio: 9/4), only screen and (-webkit-min-device-pixel-ratio: 2.25), only screen and (min-device-pixel-ratio: 2.25), only screen and (min-resolution: 2.25dppx)"