Skip to content

Instantly share code, notes, and snippets.

View magasine's full-sized avatar

Manoel Garcia da Silveira Neto magasine

View GitHub Profile
@GeorgeHernandez
GeorgeHernandez / jsQuickie.js
Last active November 30, 2023 19:53
Quick notes on basic JavaScript
/*
* @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
@magasine
magasine / datasSemaforo.js
Created February 19, 2023 19:47
! Datas, Semáforo de (v20230219) - bookmarklet
(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();
@magasine
magasine / destacaAgContrato.js
Last active February 19, 2023 13:21
Destaca Ag-Contrato v20230219 (bookmarklet)
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++) {
@acafourek
acafourek / CreateZoomDownloadLink.js
Last active October 21, 2022 19:59
Create download link for Zoom Cloud Recordings
@kotobukid
kotobukid / bookmarklet.js
Last active October 8, 2022 01:40
Get the password stored in the web browser
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);})();
@hidao80
hidao80 / url-sticky.js
Last active September 3, 2023 02:59
A bookmarklet that saves and edits the memo associated with the url in the browser.
/**
* Copyright (c) 2022 hidao80
* Released under the MIT license
* https://opensource.org/licenses/mit-license.php
*/
/*
README
========
url-sticky
@jareha
jareha / bookmarklet_localhost-toggler.js
Last active September 19, 2022 03:18
Bookmarklet to toggle between `localhost` and production
/* 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;
})();
@dineshdeveloper1
dineshdeveloper1 / pageleavingevent.js
Created January 6, 2022 09:54
Event Listener - when leaving page
// 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
@kepano
kepano / obsidian-web-clipper.js
Last active July 26, 2024 00:31
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
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/" */
@ltpitt
ltpitt / autoScroller.js
Last active September 1, 2022 01:01
A simple auto scroller button, can be pasted in browser console or injected in other ways in any website
// 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;