Skip to content

Instantly share code, notes, and snippets.

View ExileofAranei's full-sized avatar

Denis Mamaev ExileofAranei

View GitHub Profile
@ExileofAranei
ExileofAranei / _decimal.scss
Created January 13, 2021 22:09 — forked from terkel/_decimal.scss
Rounding decimals in Sass
// _decimal.scss | MIT License | gist.github.com/terkel/4373420
// Round a number to specified digits.
//
// @param {Number} $number A number to round
// @param {Number} [$digits:0] Digits to output
// @param {String} [$mode:round] (round|ceil|floor) How to round a number
// @return {Number} A rounded number
// @example
// decimal-round(0.333) => 0
@ExileofAranei
ExileofAranei / services.js
Created September 16, 2020 17:48 — forked from bullgare/services.js
form serialization in pure js
serialize: function serialize(form)
{
if (!form || form.nodeName !== "FORM") {
return;
}
var i, j,
obj = {};
for (i = form.elements.length - 1; i >= 0; i = i - 1) {
if (form.elements[i].name === "") {
continue;