Skip to content

Instantly share code, notes, and snippets.

View adelpro's full-sized avatar
馃挱
丕賱丨賲丿 賱賱賴

adelpro adelpro

馃挱
丕賱丨賲丿 賱賱賴
View GitHub Profile
async function subscribe() {
let response = await fetch("/subscribe");
if (response.status == 502) {
// Status 502 is a connection timeout error,
// may happen when the connection was pending for too long,
// and the remote server or a proxy closed it
// let's reconnect
await subscribe();
return
@adelpro
adelpro / hidepassword.svg
Last active October 29, 2022 15:57
hide password svg icon
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adelpro
adelpro / email.svg
Created October 24, 2022 18:12
Email svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adelpro
adelpro / app-min.js
Created October 24, 2022 08:32
simple minified javascript files
const button=document.getElementById("my-button"),paragraph=document.getElementById("my-paragraph");button.addEventListener("click",(()=>{paragraph.style.backgroundColor="white",paragraph.innerText="It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.\n The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here,\n content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum \n as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions \n have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like)."}));
@adelpro
adelpro / app.js
Last active October 24, 2022 08:31
simple javascript file
const button = document.getElementById("my-button");
const paragraph = document.getElementById("my-paragraph");
button.addEventListener("click", () => {
paragraph.style.backgroundColor = "white";
paragraph.innerText = `It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.
The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here,
content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum
as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions
have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).`;
console.log("button clicked");
@adelpro
adelpro / javascript-mimified.js
Created October 24, 2022 07:17
javascript - mimified
function createScript(e){const t=`https://dorar.net/dorar_api.json?skey=${e}&callback=hadithFetch2`;let n=document.createElement("script");n.setAttribute("src",t),n.setAttribute("id","jsonp");const a=document.getElementById("jsonp"),c=document.getElementsByTagName("head")[0];a?c.replaceChild(n,a):c.appendChild(n)}const hadithFetch2=async e=>{let t=document.getElementById("dorar"),n=document.getElementById("loader");const a=await(e?.ahadith?.result);a&&t&&n?(n.className="loader-hide",t.innerHTML=a):(t.innerHTML="",n.className="center")};window.onload=()=>{let e=document.getElementById("skey"),t=document.getElementById("bsearch"),n=document.getElementById("navigation-button"),a=document.getElementsByTagName("body")[0];e.focus(),e.addEventListener("keypress",(function(e){"Enter"===e.key&&(e.preventDefault(),t.click())})),n.addEventListener("click",(function(e){e.preventDefault(),a.classList.toggle("nav-open"),n.toggleAttribute("aria-expanded")})),t.addEventListener("click",(t=>{t.preventDefault(),createScript(e.
@adelpro
adelpro / jquery.lazyload.js
Created February 9, 2019 14:29 — forked from terkel/jquery.lazyload.js
jQuery Lazy Load plugin
/*!
* jQuery Lazy Load plugin v0.9.2
* https://gist.github.com/1520842
*
* Copyright (c) 2012 Takeru Suzuki - http://terkel.jp/
* Licensed under the MIT license - http://www.opensource.org/licenses/MIT
*/
(function (window, $) {
$.fn.lazyLoad = function (options) {