Skip to content

Instantly share code, notes, and snippets.

View maanimis's full-sized avatar
💬

Meisam Maani maanimis

💬
View GitHub Profile
@maanimis
maanimis / README.md
Last active February 15, 2025 18:35
Server-Sent Events (SSE) in Node.js using Express

From chatgpt

Handling Load Balancers

  • SSE requires sticky sessions if behind a load balancer, like Nginx.
  • Example Nginx config for SSE:
location /events {
    proxy_pass http://your-node-server;
 proxy_set_header Connection '';
@maanimis
maanimis / YouTube-URL-Cleaner.js
Last active February 25, 2025 07:53
Clean YouTube URLs to only keep the video ID when Shift + Left Click is used
// ==UserScript==
// @name YouTube URL Cleaner
// @namespace http://tampermonkey.net/
// @version 1.6
// @description Clean YouTube URLs to only keep the video ID when Shift + Left Click is used and show a popup
// @author maanimis
// @match *://*.youtube.com/*
// @grant clipboardWrite
// @run-at document-end
// @license MIT
@maanimis
maanimis / Full-Page-Hijacker.js
Last active February 15, 2025 18:52
Modify all scripts and HTML content dynamically
// ==UserScript==
// @name Full Page Hijacker
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Modify all scripts and HTML content dynamically
// @author You
// @match *://*/*
// @grant none
// ==/UserScript==
@maanimis
maanimis / script.hijacker.js
Created February 12, 2025 15:47
Replace a specific script file with your own
// ==UserScript==
// @name Script Hijacker
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Replace a specific script file with your own
// @author You
// @match *://*/*
// @grant none
// ==/UserScript==
@maanimis
maanimis / remove-element-shift+click.js
Last active February 23, 2025 09:10
a userscript that allows you to detect elements when you hover over them, highlight them, and remove them when you press Shift + Click. This script works on any webpage.
// ==UserScript==
// @name remove-element-shift+click
// @description a userscript that allows you to detect elements when you hover over them, highlight them, and remove them when you press Shift + Click. This script works on any webpage.
// @namespace Violentmonkey Scripts
// @match https://*/*
// @grant none
// @version 1.0
// @author maanimis
// @run-at document-end
// @license MIT
@maanimis
maanimis / extra.ws.conn.js
Last active February 2, 2025 22:04
Creates Extra WebSocket Connections
const originalWebSocket = window.WebSocket;
class MultiWebSocket {
constructor(...args) {
this.args = args;
this.maxConn = 2;
this.extraSockets = [];
this.mainWS = new originalWebSocket(...args);
this.isSending = false;
@maanimis
maanimis / territorial.io.cheat.js
Last active February 2, 2025 22:45
This script will create the grid of iframes on the territorial.io site every time you visit it, based on the MULTIPLIER value!
(function () {
const MULTIPLIER = +prompt("MULTIPLIER", "2");
const URL = "https://territorial.io/";
function createIframes(count) {
let container = document.getElementById("iframeContainer");
if (!container) {
container = document.createElement("div");
container.id = "iframeContainer";
document.body.innerHTML = "";
@maanimis
maanimis / web.archive.helper.userscript.js
Last active February 23, 2025 09:13
This userscript adds options to quickly search or save the current page on the Internet Archive via the browser's userscript menu.
// ==UserScript==
// @name Web Archive Helper
// @namespace http://tampermonkey.net/
// @version 1.6
// @description Add options to search or save pages on web.archive.org and archive.today
// @author maanimis
// @match *://*/*
// @grant GM_registerMenuCommand
// @grant GM_openInTab
// @license MIT
// ==UserScript==
// @name hijack-fetch
// @namespace Violentmonkey Scripts
// @match *://*/*
// @grant none
// @version 1.0
// @author maanimis
// @description 1/26/2025, 1:31:21 PM
// @run-at document-end
// @license MIT
// ==UserScript==
// @name hijack-xhr
// @namespace Violentmonkey Scripts
// @match *://*/*
// @grant none
// @version 1.0
// @author maanimis
// @description 1/26/2025, 1:35:29 PM
// @run-at document-end
// @license MIT