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
| 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 |
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
| Force Remove the .git folder in windows | |
| // working | |
| rm -r .git -Force | |
| // not working | |
| rm -rf .git |
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(root,factory){if(typeof define==="function"&&define.amd){define(factory)}else if(typeof exports==="object"){module.exports=factory()}else{root.latinize=factory()}})(this,function(){function latinize(str){if(typeof str==="string"){return str.replace(/[^A-Za-z0-9]/g,function(x){return latinize.characters[x]||x})}else{return str}}latinize.characters={"Á":"A","Ă":"A","Ắ":"A","Ặ":"A","Ằ":"A","Ẳ":"A","Ẵ":"A","Ǎ":"A","Â":"A","Ấ":"A","Ậ":"A","Ầ":"A","Ẩ":"A","Ẫ":"A","Ä":"A","Ǟ":"A","Ȧ":"A","Ǡ":"A","Ạ":"A","Ȁ":"A","À":"A","Ả":"A","Ȃ":"A","Ā":"A","Ą":"A","Å":"A","Ǻ":"A","Ḁ":"A","Ⱥ":"A","Ã":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ḃ":"B","Ḅ":"B","Ɓ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ć":"C","Č":"C","Ç":"C","Ḉ":"C","Ĉ":"C","Ċ":"C","Ƈ":"C","Ȼ":"C","Ď":"D","Ḑ":"D","Ḓ":"D","Ḋ":"D","Ḍ":"D","Ɗ":"D","Ḏ":"D","Dz":"D","Dž":"D","Đ":"D","Ð":"D","Ƌ":"D","DZ":"DZ","DŽ":"DZ","É":"E","Ĕ":"E","Ě":"E","Ȩ":"E","Ḝ":"E","Ê":"E","Ế":"E","Ệ":"E","Ề":"E","Ể":"E","Ễ":"E","Ḙ":"E","Ë":"E","Ė":"E","Ẹ":" |
NewerOlder