Skip to content

Instantly share code, notes, and snippets.

@maanimis
maanimis / CONCURRENCY.md
Created December 7, 2025 17:07 — forked from montanaflynn/CONCURRENCY.md
Examples of sequential, concurrent and parallel requests in node.js

Concurrency in JavaScript

Javascript is a programming language with a peculiar twist. Its event driven model means that nothing blocks and everything runs concurrently. This is not to be confused with the same type of concurrency as running in parallel on multiple cores. Javascript is single threaded so each program runs on a single core yet every line of code executes without waiting for anything to return. This sounds weird but it's true. If you want to have any type of sequential ordering you can use events, callbacks, or as of late promises.

Ubuntu/Debian Server Security Setup Guide

Prerequisites

  • Fresh Ubuntu/Debian server installation
  • Root or sudo access
  • Basic familiarity with command line

Step 1: Initial System Update

{
// UI
"workbench.iconTheme": "hypernym-icons",
"workbench.colorTheme": "FullstacksJS (Dark)",
"editor.cursorSmoothCaretAnimation": "on",
"editor.cursorBlinking": "smooth",
"editor.fontFamily": "'Monaspace Argon', 'DejaVuSansM Nerd Font', sans",
"editor.codeLensFontFamily": "'Monaspace Argon'",
"editor.inlineSuggest.fontFamily": "'Monaspace Argon'",
"markdown.preview.fontFamily": "'Monaspace Argon'",
// ==UserScript==
// @name auto-download-subtitletools
// @namespace http://tampermonkey.net/
// @version 2025-12-03
// @description try to take over the world!
// @author You
// @match https://subtitletools.com/subtitle-sync-shifter/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=subtitletools.com
// @grant none
// ==/UserScript==
@maanimis
maanimis / Function_Class_Hooking_Utility.ts
Last active October 30, 2025 09:06
Provides comprehensive hooking capabilities for functions and classes
/**
* Function and Class Hooking Utility
* Provides comprehensive hooking capabilities for functions and classes
*/
// Types for hook callbacks
type BeforeHook<T extends any[] = any[]> = (...args: T) => void | [...T];
type AfterHook<T = any> = (result: T, ...args: any[]) => T | void;
type ErrorHook = (error: Error, ...args: any[]) => void;
@maanimis
maanimis / GitHub-Follower-Tracker.userscript.js
Last active October 21, 2025 18:37
Track GitHub followers&following
// ==UserScript==
// @name GitHub Follower Tracker
// @namespace http://tampermonkey.net/
// @version 1.1
// @description Track GitHub followers&following
// @author maanimis
// @match https://github.com/*?tab=following
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_listValues
const CACHE_NAME = 'my-cache-v1';
// هنگام نصب Service Worker، می‌تونیم فایل‌های اولیه رو کش کنیم
self.addEventListener('install', (event) => {
console.log('[Service Worker] Installing...');
event.waitUntil(
caches.open(CACHE_NAME).then((cache) => {
console.log('[Service Worker] Pre-caching some assets');
return cache.addAll([
'/', // index.html
@maanimis
maanimis / Heading-Fragment-Linker.userscript.js
Created August 5, 2025 05:51
Add clickable fragment links to all headings
// ==UserScript==
// @name Heading Fragment Linker
// @namespace http://tampermonkey.net/
// @version 2.0
// @description Add clickable fragment links to all headings
// @author maanimis
// @match *://*/*
// @grant none
// @license MIT
// ==/UserScript==
@maanimis
maanimis / WebSocketMultiplexer.userscript.js
Last active August 8, 2025 07:47
Intercepts WebSocket connections and creates multiple connections instead of one(with Reconnect)
// ==UserScript==
// @name WebSocket Connection Multiplier+Reconnect
// @namespace http://tampermonkey.net/
// @version 3.1
// @description Intercepts WebSocket connections and creates multiple connections instead of one
// @author maanimis
// @match https://example.com/
// @icon https://www.google.com/s2/favicons?sz=64&domain=example.com
// @grant none
// @run-at document-start