Skip to content

Instantly share code, notes, and snippets.

@leandrodaher
leandrodaher / debug-events.js
Created February 13, 2023 17:05 — forked from alessioalex/debug-events.js
intercept *.addEventListener for debugging
// http://stackoverflow.com/questions/4787698/failure-to-override-elements-addeventlistener-in-firefox
(function() {
Error.stackTraceLimit = Infinity;
var _interfaces = Object.getOwnPropertyNames(window).filter(function(i) {
return /^HTML/.test(i);
}).map(function(i) {
return window[i];
});
@leandrodaher
leandrodaher / validation-cpf.ts
Created April 19, 2023 01:17 — forked from joaohcrangel/validation-cpf.ts
Função para validar CPF em TypeScript
function isValidCPF(value: string) {
if (typeof value !== 'string') {
return false;
}
value = value.replace(/[^\d]+/g, '');
if (value.length !== 11 || !!value.match(/(\d)\1{10}/)) {
return false;
}
@leandrodaher
leandrodaher / temporary-email-address-domains
Created May 3, 2023 12:22 — forked from adamloving/temporary-email-address-domains
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com
@leandrodaher
leandrodaher / temp-email.txt
Created May 3, 2023 12:23 — forked from bitbybit/temp-email.txt
List of temporary email services
mailspeed.ru
mailinator.com
shitmail.me
temp-mail.ru
thismail.ru
sharklasers.com
guerrillamailblock.com
guerrillamail.com
guerrillamail.net
guerrillamail.biz
Get-ChildItem . |% {mv $_.name "$([guid]::NewGuid().ToString()+$_.extension)"}
@leandrodaher
leandrodaher / genBash.js
Created May 18, 2023 15:03 — forked from Krazete/genBash.js
Download an MP4 file from a master.json's list of M4S files.
function genBash(masterURL) {
var xhr = new XMLHttpRequest();
xhr.open("GET", masterURL, true);
xhr.addEventListener("load", function () {
var master = JSON.parse(this.responseText);
var baseURL = new URL(master.base_url, masterURL);
function genBashLines(mp4, type) {
var mp4BaseURL = new URL(mp4.base_url, baseURL);
var segmentURLs = mp4.segments.map(segment => segment.url);
@leandrodaher
leandrodaher / vimeo-downloader.js
Created May 18, 2023 15:05 — forked from mistic100/vimeo-downloader.js
Download video from Vimeo (chopped m4s files)
// 1. Open the browser developper console on the network tab
// 2. Start the video
// 3. In the dev tab, locate the load of the "master.json" file, copy its full URL
// 4. Run: node vimeo-downloader.js "<URL>"
// 5. Combine the m4v and m4a files with mkvmerge
const fs = require('fs');
const url = require('url');
const https = require('https');
@leandrodaher
leandrodaher / olx.js
Created May 20, 2023 19:19 — forked from phpenterprise/olx.js
OLX Data Extractor (Scraping)
(Olx = {
release: '1.0.5 RC',
j: $,
path: window.location.href,
settings: {
debug: true,
url: window.location.href.replace(/\.(\w+)\/.*/, '.$1') + '/vi/{id}?rec=h',
filename: "olx.csv",
split: 100,
speed: 700,
@leandrodaher
leandrodaher / composing-software.md
Created June 5, 2023 14:44 — forked from rosario/composing-software.md
Eric Elliott's Composing Software Series
@leandrodaher
leandrodaher / cross-origin-local-storage.js
Created June 16, 2023 19:23 — forked from buren/cross-origin-local-storage.js
Cross origin local storage sharing example (using an iframe and postMessage)
const CrossOriginLocalStorage = function(currentWindow, iframe, allowedOrigins, onMessage) {
this.allowedOrigins = allowedOrigins;
let childWindow;
// some browser (don't remember which one) throw exception when you try to access
// contentWindow for the first time, it works when you do that second time
try {
childWindow = iframe.contentWindow;
} catch(e) {
childWindow = iframe.contentWindow;