// manifest.json { "manifest_version": 3, "name": "Simple CRUD System", "version": "1.0", "permissions": [ "storage" ], "background": { "service_worker": "background.js"
This file contains hidden or 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 toDMS(deg) { | |
var d = Math.floor(deg); | |
var min = Math.floor((deg - d) * 60); | |
var sec = ((deg - d - min / 60) * 3600).toFixed(2); | |
return d + "° " + min + "' " + sec + "\""; | |
} | |
function convertLatLngToDMS(lat, lng) { | |
var latDMS = lat >= 0 ? "N" : "S"; | |
var lngDMS = lng >= 0 ? "E" : "W"; |
This file contains hidden or 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
window.adev = window.adev || {}; | |
(function ($) { | |
"use strict"; | |
adev.videoPlayer = { | |
init: function() { | |
$('[data-adev-arth-media-player]').each(function(index, el){ | |
const self = $(this); |
This file contains hidden or 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
/** | |
* Stores a value in the localStorage with an optional expiration time. | |
* | |
* @param {string} key - The key to associate with the stored value. | |
* @param {*} value - The value to be stored. | |
* @param {number} expiration - The duration in milliseconds for which the item should be stored before it expires. | |
*/ | |
function setItemWithExpiration(key, value, expiration) { | |
const item = { | |
value: value, |
This file contains hidden or 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
<?php | |
class ImageResizer { | |
private $cacheDir; | |
private $cacheDirUri; | |
/** | |
* WPImageResizer constructor. | |
* |
This file contains hidden or 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
^\s*$\n |
This file contains hidden or 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
<?php | |
/* | |
USAGES | |
require __DIR__ . '/AssetsManager.php'; | |
$assets = new AssetsManager( 'assets/', 'cache/'); | |
This file contains hidden or 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 getVisiblePercentage(element) { | |
const rect = element.getBoundingClientRect(); | |
const windowHeight = window.innerHeight || document.documentElement.clientHeight; | |
const visibleHeight = Math.min(rect.bottom, windowHeight) - Math.max(rect.top, 0); | |
const percentage = visibleHeight / rect.height * 100; | |
return percentage; | |
} |
This file contains hidden or 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 generateReadMode(words, element) { | |
element.innerHTML = words | |
.split(" ") | |
.map(w => `<b>${w.split("").slice(0, Math.ceil(w.length / 2)).join("")}</b>${w.split("").slice(Math.ceil(w.length / 2), w.length).join("")} `) | |
.join(" "); | |
} | |
const text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sodales, dolor eu rhoncus varius, orci lacus dictum eros, sed sodales nunc ante quis dolor. Donec eleifend faucibus ex. Curabitur justo nibh, dignissim sit amet malesuada sed, lacinia cursus elit. Etiam ut sapien a nisi porttitor sagittis id nec dui. Etiam tortor sapien, ultrices porta lacus ut, molestie maximus tortor. Vestibulum vehicula lectus sed tincidunt rutrum. Suspendisse magna eros, porttitor eu dui ut, rutrum iaculis augue. Etiam fringilla lacinia mauris, nec blandit nibh viverra sed. Phasellus sit amet purus eu ante convallis posuere.'; | |
const element = document.querySelector('.normal-text'); | |
generateReadMode(text, element) |
This file contains hidden or 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
/*! js-cookie v3.0.1 | MIT */ | |
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self,function(){var n=e.Cookies,o=e.Cookies=t();o.noConflict=function(){return e.Cookies=n,o}}())}(this,(function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}return function t(n,o){function r(t,r,i){if("undefined"!=typeof document){"number"==typeof(i=e({},o,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var u in i)i[u]&&(c+="; "+u,!0!==i[u]&&(c+="="+i[u].split(";")[0]));return document.cookie=t+"="+n.write(r,t)+c}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],o={},r=0;r<t.length;r++){var |