This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function randomIntFromInterval(min, max, not) { | |
var _return = Math.floor(Math.random() * (max - min + 1) + min); | |
if(_return === not){ | |
return randomIntFromInterval(min, max, not); | |
} | |
return _return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin css-border-arrow($dir, $fullborder, $size, $bordersize, $color, $bordercolor) { | |
$border_position_color: ''; | |
$margin_position: 'left'; | |
$absoluteXposition: 'left'; | |
$absoluteYposition: 'top'; | |
$Xposition: 50%; | |
$Yposition: 50%; | |
$borderarrowsize: $size + $bordersize + 2; | |
$marginborderarrowsize: $size + $bordersize + 2; | |
$marginsize: $size; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grunt.initConfig({ | |
less: { | |
development: { | |
files: [{ | |
expand: true, | |
cwd: 'src/', | |
src: ['**/*.less'], | |
dest: 'css/', | |
ext: '.css', | |
rename: function(dest, src) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SPAajaxloading = function () { | |
var $links = $('#nav a'); | |
var historyCache = {}; | |
var getCache = function (url) { | |
return historyCache[url]; | |
}; | |
var setCache = function (url, content) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* @param date Date | |
* @param dayOfWeek {Number} between 1 (monday) to 7 (sunday) | |
*/ | |
var getDayOfWeek = function (date, dayOfWeek) { | |
if(dayOfWeek > 7 || dayOfWeek < 1){ | |
console.warn('dayOfWeek is out of range (1-7), was:', dayOfWeek); | |
} | |
var _date = new Date(date); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getTpl = (function () { | |
"use strict"; | |
let cache = {}; | |
var getCache = function (templateId) { | |
return cache[templateId]; | |
}; | |
var setCache = function (templateId, html) { | |
cache[templateId] = html; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var countItems = function (_array) { | |
return Array.from(new Set(_array)).length; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var modifyInputValue = function ($elem, e, value, gap = 0) { | |
var target = e.target, | |
position = target.selectionStart; // Capture initial position | |
$elem.val(value); | |
target.selectionEnd = position + gap; // Set the cursor back to the initial position. | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getCookies = function(){ | |
document.cookie.split(';').reduce(function(acc, curr, arr){ | |
let _split = curr.split('='); | |
acc[_split[0].trim()] = _split[1]; | |
return acc; | |
},{}) | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//accepted = {id: true} | |
//qs = {id: 'lol', kikoo: 'yes'} | |
let filterKeys = function (accepted, qs) { | |
return Object.keys(qs).reduce(function (acc, curr) { | |
if (accepted[curr]) { | |
acc[curr] = qs[curr] | |
} | |
return acc; | |
}, {}) | |
}; |
OlderNewer