Skip to content

Instantly share code, notes, and snippets.

View ggarek's full-sized avatar

Igor Ovsiannikov ggarek

View GitHub Profile
@ggarek
ggarek / qs.js
Last active March 28, 2018 04:51
parse query string
function getQueryParams() {
return window.location.search
.replace(/^\?/, '').split('&').filter(Boolean)
.map(function(kv) { return kv.split('='); })
.reduce(function(a, next) { return (a[next[0]] = decodeURIComponent(next[1]), a); }, {});
}
@ggarek
ggarek / README.md
Last active February 15, 2017 18:07
CSS Goodies #1

Statement: How to make a block to have proper height based on the given width and dimensions ratio.

Origin | This demo

tags: html, css, layout, keep ratio, 4x3, 16x19, aspect, height

@ggarek
ggarek / .block
Last active December 29, 2016 22:35
SEF Stats
license: gpl-3.0
@ggarek
ggarek / convert-amd-to-es6.md
Last active August 28, 2015 21:10
Shell scarpbook

I had a task to convert a project which was written using AMD and partially in ES6 (new code).

This gist describes my approach in details.

###Prerequisites The codebase is written in AMD and paritally in ES6. All AMD modules have simple .js extension, whereas all ES6 modules have .es6.js extension.

###Used tools

  • bash