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
@salman0ansari
salman0ansari / script.js
Created January 19, 2026 07:20
enable calls on whatsapp web
// ==UserScript==
// @name WhatsApp Web Calling Enabler
// @namespace https://hisalman.in
// @version 1.0
// @description Enable calling features in WhatsApp Web by overriding AB test configurations.
// @author salman0ansari
// @match https://web.whatsapp.com/*
// @run-at document-start
// @grant none
// ==/UserScript==
@salman0ansari
salman0ansari / decrypt.go
Created January 13, 2026 14:05
decrypt call offer whatsmeow
// return the decrypted payload bytes, or nil if no <enc> node was found.
func (cli *Client) decryptCallOffer(ctx context.Context, offerNode *waBinary.Node, callCreator types.JID, timestamp time.Time) ([]byte, error) {
// Find the <enc> node inside the offer
encNode, ok := offerNode.GetOptionalChildByTag("enc")
if !ok {
return nil, nil // No encrypted content
}
content, ok := encNode.Content.([]byte)
if !ok {
{
"version": "",
"name": "",
"assetdir": "",
"reloaddirs": "",
"build:dir": "",
"frontend:dir": "",
"frontend:install": "",
"frontend:build": "",
"frontend:dev": "",
@salman0ansari
salman0ansari / file.md
Created January 31, 2025 07:12
fix: Cusor too many free trial accounts used on this machine

fix: Too many free trial accounts used on this machine

1. Close Cursor Completely

Ensure that Cursor is not running before making any changes.

2. Locate the Configuration File

@salman0ansari
salman0ansari / keybase.md
Created January 23, 2025 12:31

Keybase proof

I hereby claim:

  • I am salman0ansari on github.
  • I am salman0ansari (https://keybase.io/salman0ansari) on keybase.
  • I have a public key ASB4PMtSFcqEpJjAWM3aAr62yjkO5V3f0Yk6NHChBx2oEQo

To claim this, I am signing this object:

@salman0ansari
salman0ansari / index.js
Created September 10, 2024 07:18
Luhn's Algorithm
// https://x.com/cneuralnetwork/status/1831989042826629546
const digits = "4137894711755904";
let sum = [];
digits.split("").map((digit, index) => {
if (index % 2 === 0) {
const double = +digit * 2;
if (double > 9) {
let pushItem = String(double)
---
swagger: "2.0"
info:
description: |
This is a swagger defenition for [Telegram bot API](https://core.telegram.org/bots/api).
version: "3.6"
title: Telegram Bot API
host: api.telegram.org
schemes:
- https

1. Install Node/NPM

curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -

sudo apt install nodejs

sudo apt install npm
@salman0ansari
salman0ansari / storage-notify.sh
Created September 13, 2023 14:08
get telegram notification if storage is above x%
#!/bin/bash
check_storage() {
# Get the disk usage percentage
usage=$(df -h --output=pcent / | tail -n 1 | tr -d ' %')
if [ "$usage" -ge 70 ]; then
return 0
else
return 1
fi
import React, { useEffect } from 'react';
import { Space, Table, Tag } from 'antd';
import type { ColumnsType } from 'antd/es/table';
import { atom, useAtom } from 'jotai'
import { currentTableData } from './atoms';
interface DataType {
Id: string;
Jid: string;
Name: string;