Skip to content

Instantly share code, notes, and snippets.

View ciases's full-sized avatar

Dmitry Pashkovets ciases

View GitHub Profile
@ciases
ciases / cloudSettings
Last active February 14, 2021 19:24
Visual Studio Code Sync Settings Gist
{"lastUpload":"2020-12-03T09:17:53.371Z","extensionVersion":"v3.4.3"}
@ciases
ciases / snippets.md
Last active February 6, 2017 09:07
A bit of snippets
@ciases
ciases / .gitconfig
Last active April 13, 2017 12:24
Human Git
[alias]
unstage = reset -q HEAD --
discard = checkout --
nevermind = !git reset --hard HEAD && git clean -d -f
uncommit = reset --mixed HEAD~
save = commit -m
resave = commit --amend
invert = revert
last = log -1 HEAD --format=format:"%Cred%H"
summary = status -u -s
@ciases
ciases / image-optimization.md
Created January 25, 2017 08:32
Image optimization tools (online, offline)

There are also online tools which can help you optimize your pictures with loss of quality, by performing safe automatic tasks:

If you are at ease with command line tools, you can use these:

  • Pngnq: converts 24-bit PNG files into 6 to 8-bit ones, by only keeping the needed colors. Download:
@ciases
ciases / svg-animation.html
Created October 13, 2016 14:26
SVG path animation
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style>
.path {
@ciases
ciases / convert.md
Last active September 2, 2016 08:56
Use ImageMagick to create optimised and progressive JPGs

Use ImageMagick to create optimised and progressive JPGs

Use the following command to optimise a JPG and make it progressive:

$ convert -strip -interlace Plane -quality 80 input-file.jpg output-file.jpg

Batch all the images in a folder like this:

$ for i in source/images/backgrounds/*.jpg; do convert -strip -interlace Plane -quality 80 $i $i; done
@ciases
ciases / button.html
Created July 26, 2016 09:19
Bootstrap input type file
<style>
.btn-file {
position: relative;
overflow: hidden;
}
.btn-file input[type=file] {
position: absolute;
top: 0;
right: 0;
min-width: 100%;
@ciases
ciases / gulpfile.js
Created June 30, 2016 11:29
Gulp + BrowserSync (minimal config)
// Usage:
// $ npm install gulp browser-sync --save-dev
// $ gulp serve
'use strict';
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
gulp.task('serve', function() {
@ciases
ciases / gulpfile.js
Created June 20, 2016 08:21
Gulp less error handling
'use strict';
var gulp = require('gulp');
var less = require('gulp-less');
var sourcemaps = require('gulp-sourcemaps');
var browserSync = require('browser-sync').create();
var rigger = require('gulp-rigger');
var autoprefixer = require('gulp-autoprefixer');
// variant 1: without `return`
@ciases
ciases / parallax-scroll.js
Created April 17, 2016 07:46
Easy parallax scroll effect
// https://bolt.cm/
// MAKE TOPIMAGE SCROLL SLOWER FOR PARALLAX EFFECT
$(window).scroll(function () {
$('header').css('backgroundPosition', '0px ' + (posTop() / 2) + 'px');
});
// FIX FOR SCROLLPOS IN ALL BROWSERS
function posTop() {
return typeof window.pageYOffset != 'undefined' ? window.pageYOffset: document.documentElement.scrollTop? document.documentElement.scrollTop: document.body.scrollTop? document.body.scrollTop:0;