Skip to content

Instantly share code, notes, and snippets.

View Kamran-Karimi's full-sized avatar
💭
💻 Developer crafting clean, scalable code | Lifelong learner

Kamran Karimi Kamran-Karimi

💭
💻 Developer crafting clean, scalable code | Lifelong learner
  • Vobysoft
  • Iran , Tehran
View GitHub Profile
@pavellauko
pavellauko / LICENSE
Last active December 1, 2024 19:54
Time zones as arrays (PHP)
MIT License
Copyright (c) 2022 Justin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@kpuputti
kpuputti / gist:1040118
Created June 22, 2011 13:49
jQuery.getJSON abstraction to cache data to localStorage
var getCachedJSON = function (url, callback) {
var cachedData = window.localStorage[url];
if (cachedData) {
log('Data already cached, returning from cache:', url);
callback(JSON.parse(cachedData));
} else {
$.getJSON(url, function (data) {
log('Fetched data, saving to cache:', url);
window.localStorage[url] = JSON.stringify(data);
callback(data);