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 / 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;
@salman0ansari
salman0ansari / buffer.ts
Created March 25, 2023 08:30
puppeteer serverless
import chromium from '@sparticuz/chrome-aws-lambda';
export const GenerateBuffer = async (content) => {
try {
const puppeteer = chromium.puppeteer;
const browser = await puppeteer.launch({
args: chromium.args,
executablePath: await chromium.executablePath,
});
console.log('We have a browser', browser);
@salman0ansari
salman0ansari / hwid.go
Created March 12, 2023 13:08
hwid generator
package main
import (
"crypto/rsa"
"crypto/sha256"
"crypto/x509"
"encoding/base64"
"encoding/pem"
"fmt"
"io/ioutil"
@salman0ansari
salman0ansari / twitter-query.php
Created January 26, 2023 12:25 — forked from AzureFlow/twitter-query.php
Get last X tweets from a user.
<?php declare(strict_types=1);
require __DIR__ . '/../vendor/autoload.php';
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\RequestOptions;
// ==================== //