Skip to content

Instantly share code, notes, and snippets.

View blestab's full-sized avatar
🏠
Working from home

Blessed Ndoro blestab

🏠
Working from home
View GitHub Profile
@blestab
blestab / getCachedJSON.js
Created April 15, 2017 16:23 — forked from k0pernikus/getCachedJSON.js
jQuery.getJSON abstraction to cache data to localStorage with invalidation option based time
jQuery.extend({
getCachedJSON: function (url, callback) {
var cacheTimeInMs = 3600000;
var currentTimeInMs = new Date().getTime();
var cache = {
data:null,
timestamp:null
};
@blestab
blestab / color object
Created October 12, 2018 10:41 — forked from OneCent01/color object
Every color contained in an object with its corresponding hexa value for O(1) time lookup, find function below object
var colors = {
ALICEBLUE: '#F0F8FF',
ANTIQUEWHITE: '#FAEBD7',
AQUA: '#00FFFF',
AQUAMARINE: '#7FFFD4',
AZURE: '#F0FFFF',
BEIGE: '#F5F5DC',
BISQUE: '#FFE4C4',
BLACK: '#000000',
BLANCHEDALMOND: '#FFEBCD',