Skip to content

Instantly share code, notes, and snippets.

View salman0ansari's full-sized avatar
$ yay -S brain

Mohd Salman salman0ansari

$ yay -S brain
View GitHub Profile
@aravindanve
aravindanve / bypass-disable-devtool.md
Last active June 4, 2025 13:42
Bypass disable-devtool

(Working as of 2025-02-09)

There are websites that use disable-devtool to prevent you from opening or using devtools. They typically prevent you from right clicking or using the keyboard shortcut to open devtools. Even if you successfully do so, they detect it and redirect you elsewhere. You can bypass this by using one of the following ways.

Opening devtools

If the shortcut F12 on Windows or Option + ⌘ + I on Mac do not work. Press the three vertically aligned dots in the top right corner of your Google Chrome or Microsoft Edge window. Under the section "More Tools", you'll see the option to select "Developer Tools" which opens the toolkit in your window.

@SwapnilSoni1999
SwapnilSoni1999 / libmagic.ts
Created May 30, 2024 05:57
Universal libmagic file validator, Multer Helper
import fs from 'fs'
import { FileMagic, MagicFlags } from '@npcz/magic'
import { extension } from 'mime-types'
import path from 'path'
import os from 'os'
FileMagic.magicFile = require.resolve(
'@npcz/magic/dist/magic.mgc'
)
@SwapnilSoni1999
SwapnilSoni1999 / validator.middleware.ts
Created May 30, 2024 05:54
Universal zod validator for express.js
import { AnyZodObject, ZodTypeAny } from 'zod'
import {
NextFunction,
Request,
RequestHandler,
Response
} from 'express'
import { HttpError } from '@/lib/errors.lib'
type RequestPayloadIn = 'body' | 'query' | 'params'
@cyco130
cyco130 / promises.js
Created December 26, 2023 17:52
Promise test
function fnThatReturnsPromiseOrValue() {
const random = Math.random();
if (random > 0.5) {
return Promise.resolve(random);
} else {
return random;
}
}
async function naive() {
@NeoHBz
NeoHBz / tampermoney-github_fork_status.js
Last active June 5, 2022 17:27
Tampermoney script to show Fork Status (fork x commits ahead, y commits behind)
// ==UserScript==
// @name GitHub Fork Details
// @namespace https://gist.github.com/NeoHBz/5028c5493fb68cb167235d2c074a138c
// @version 1.0
// @description Displays if GitHub forks are behind/ahead from the parent fork
// @author NeoHBz
// @include https://github.com/*/*/network/members
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant none
// ==/UserScript==
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active May 16, 2025 13:07
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@parmentf
parmentf / GitCommitEmoji.md
Last active June 6, 2025 16:10
Git Commit message Emoji
Byobu is a suite of enhancements to tmux, as a command line
tool providing live system status, dynamic window management,
and some convenient keybindings:
F1 * Used by X11 *
Shift-F1 Display this help
F2 Create a new window
Shift-F2 Create a horizontal split
Ctrl-F2 Create a vertical split
Ctrl-Shift-F2 Create a new session
@josephspurrier
josephspurrier / values_pointers.go
Last active May 15, 2025 14:43
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
@jshaw
jshaw / byobuCommands
Last active April 25, 2025 06:20
Byobu Commands
Byobu Commands
==============
byobu Screen manager
Level 0 Commands (Quick Start)
------------------------------
<F2> Create a new window