This file contains 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
/* | |
* @fileoverview Quick notes on basic JavaScript stuff | |
* Via: https://gist.github.com/GeorgeHernandez/4819ba17676da1e14b31073a05c587fe | |
* FYI: This document assumes Semicolon Insertion (ASI) | |
*/ | |
/** | |
* Declaration const let var | |
* Safety High Medium Low | |
* Scope Block Block Global or Function |
This file contains 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 () { | |
var datePattern = /(\d{2})\/(\d{2})\/(\d{4})/; | |
var today = new Date(); | |
var dateNodes = []; | |
function isToday(date) { | |
var now = new Date(); | |
return date.getDate() === now.getDate() && | |
date.getMonth() === now.getMonth() && | |
date.getFullYear() === now.getFullYear(); |
This file contains 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
javascript: (function () { | |
var pattern = /(?<=\s|^)(?<gSR>\d{2})([\.\/\s-])?(?<gAG>\d{1,4})([\.\/\s-])?(?<gOP>\d{3})([\.\/\s-])?(?<gCONTRATO>\d{1,7})([\.\/\s-])?(?<gDV>\d{2})(?=\s|$)/g; | |
var textNodes = []; | |
function recurse(node) { | |
if (node.nodeType === Node.TEXT_NODE) { | |
textNodes.push(node); | |
} else { | |
for (var i = 0; i < node.childNodes.length; i++) { |
This file contains 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
/** | |
* Created to download Zoom Cloud recordings that do not have downloads enabled | |
* Intended to be used as a bookmarklet - fetches embedded player video source and makes it available as a link to download. | |
* July 2022 | |
**/ | |
(function(){ | |
//get all <video> tags from the page -- this will return an HTMLCollection, NOT an Array | |
let videos = document.getElementsByTagName('video'); |
This file contains 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
javascript:(() => {const id_temp = 'hogegege'; const $pass = document.createElement('input'); $pass.setAttribute('type', 'password'); $pass.setAttribute('id', id_temp); $pass.cssText = 'position: absolute; top: 0; z-index: 10000000000000;'; document.getElementsByTagName('body')[0].appendChild($pass); $pass.addEventListener('click', (e) => { setTimeout(() => { alert(document.getElementById(id_temp).value); }, 2000); }, false); setTimeout(() => { $pass.focus(); }, 500);})(); |
This file contains 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
/** | |
* Copyright (c) 2022 hidao80 | |
* Released under the MIT license | |
* https://opensource.org/licenses/mit-license.php | |
*/ | |
/* | |
README | |
======== | |
url-sticky |
This file contains 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
/* jshint esversion: 8 */ | |
(function () { | |
const domain = "https://example.com"; | |
const isLocalhost = window.location.href.indexOf("localhost") >= 0; | |
const localhost = "http://localhost:8080"; | |
const pathname = window.location.pathname; | |
const url = isLocalhost ? (domain + pathname) : (localhost + pathname); | |
window.location = url; | |
})(); |
This file contains 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
// How to detect when mouse pointer leaves viewport | |
document.addEventListener("mouseleave", function(e){ | |
if( e.clientY < 0 ) | |
{ | |
alert("Hey don't leave. we have some offer for you"); | |
} | |
}, false); | |
//for more detail- http://qnimate.com/exit-intent-using-javascript |
This file contains 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
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{ | |
default: Turndown | |
}, { | |
default: Readability | |
}]) => { | |
/* Optional vault name */ | |
const vault = ""; | |
/* Optional folder name such as "Clippings/" */ |
This file contains 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
// Simply copy and paste the following script in your browser's console, | |
// it will add an auto-scrolling button on the right part of the webpage you are visiting. | |
(function() { | |
let cssScrolling = "background-color: #f44336; border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; float:right; position:fixed; right:0; top:50%;"; | |
let cssStopped = "background-color: #4CAF50; border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; float:right; position:fixed; right:0; top:50%;"; | |
let btn = document.createElement("button"); | |
var isScrolling = false; | |
btn.innerHTML = "start scroll"; | |
btn.style.cssText = cssStopped; |
NewerOlder