Skip to content

Instantly share code, notes, and snippets.

@LoyEgor
LoyEgor / gulpfile.js
Last active March 2, 2018 22:43
resize images for responsive use
// install
// cd node_modules \
// chmod -R a+rwX .
// run without sudo
// npm i del gulp-responsive --unsafe-perm
var del = require('del');
var responsive = require('gulp-responsive');
/* fonts var */
@fdir: '../fonts/';
@ff-name: AvenirNextCyr CirceRoundedAlt;
@ff-style-1: Regular Bold BoldItalic;
@ff-style-2: Regular Bold;
@ff-count: length(@ff-name);
/* set to none if no need. Then use .ff(n,n) where first n - number of font, second for style of font */
@ff-name-short: av ci;
@ff-style-1-short: rg bd bdi;
@ff-style-2-short: rg bd;
@LoyEgor
LoyEgor / font-old.less
Last active July 16, 2017 17:41
mixin for easier custom font use
@fdir: '../fonts/';
@ff-name: 'CirceRoundedAlt';
@rg: '@{ff-name}-Regular1';
@bd: '@{ff-name}-Regular2';
.ff(@ff) {
font-family: e(replace(@ff, @ff-name, "cust-ff")), Arial, Helvetica Neue, Helvetica, sans-serif;
}
.ff-mix(@ff) {
@LoyEgor
LoyEgor / .gitignore
Last active July 11, 2017 16:15
basic gitignore
/node_modules/
/dist/
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
@LoyEgor
LoyEgor / cross.less
Created June 25, 2017 14:21
style for close icon
&:after,
&:before {
content: '';
@s: 2px;
width: 100%;
height: @s;
background-color: @brandcol1;
display: block;
position: absolute;
left: 0;
@LoyEgor
LoyEgor / macos-font.css
Created June 24, 2017 18:06
normalize fonts for macos
html {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@LoyEgor
LoyEgor / media.less
Created June 24, 2017 18:01
media with nubers
@max1200: ~"(max-width: 1199px)";
@max992: ~"(max-width: 991px)";
@max768: ~"(max-width: 767px)";
@max320: ~"(max-width: 320px)";
@min1200: ~"(min-width: 1200px)";
@min992: ~"(min-width: 992px)";
@min768: ~"(min-width: 768px)";
@min320: ~"(min-width: 321px)";
@992to1200: @min992 and @max1200;
@768to992: @min768 and @max992;
@LoyEgor
LoyEgor / gulpfile.js
Last active June 22, 2017 17:08
gulp git settings
// install
// npm i gulp-bump gulp-git run-sequence
var bump = require('gulp-bump');
var git = require('gulp-git');
var runSequence = require('run-sequence');
var fs = require('fs');
// get project files
var allgit = ['./app/**/*', './gulpfile.js', './package.json', './faviconData.json'];
// get project version
// get project version
@LoyEgor
LoyEgor / package.json
Created June 22, 2017 15:53
basic package.json
{
"name": "new project",
"version": "0.0.0",
"description": "new project",
"main": "gulpfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Loy Egor <loyegor@gmail.com> (http://loyegor.com/)",
"license": "ISC",
@LoyEgor
LoyEgor / .htaccess
Last active June 22, 2017 15:44
basic .htaccess (www redirect, gzip, 7 day changes)
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
FileETag MTime Size
<ifmodule mod_expires.c>
<filesmatch ".(jpg|gif|png|css|js|swf|svg|woff|woff2|ttf|eot)$">
ExpiresActive on
ExpiresDefault "access plus 7 day"
</filesmatch>