Skip to content

Instantly share code, notes, and snippets.

View theSoberSobber's full-sized avatar
🐢

Pavit Chhabra theSoberSobber

🐢
View GitHub Profile
@theSoberSobber
theSoberSobber / debug.h
Created January 31, 2023 18:32
my debugger
#include <bits/stdc++.h>
using namespace std;
#define dbg(x...) cerr << "[" << #x << "] = ["; _print(x)
void __print(int32_t x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(int64_t x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
@theSoberSobber
theSoberSobber / cp.json
Created January 30, 2023 14:32
some snippets for competetive programming
{
"bp": {
"prefix": "bp",
"body": [
"#include <bits/stdc++.h>",
"using namespace std;\n",
"#define ll long long int",
"#define loop(i,a,b) for(int i=a;i<b;i++)\n",
@theSoberSobber
theSoberSobber / build.sh
Last active December 29, 2022 06:17
builds a list of currently working http proxies from https://github.com/TheSpeedX/PROXY-List
#!/bin/bash
curl https://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/http.txt -o init.txt
while read -r p_url
do
echo $p_url
curl -x $p_url "https://checkip.amazonaws.com/"
done < "$(pwd)/init.txt"
rm -r init.txt
@theSoberSobber
theSoberSobber / step.sh
Last active December 3, 2022 13:17
to step through a gh repo and study it's evolution
# include in sys varaibles to use everywhere
#!/bin/bash
echo "Enter branch name : "
read bname
chlist=$(git rev-list $bname --reverse)
tcnt=$(git rev-list $bname --count)
declare -i cnt=0
for ch in $chlist
do
# temp=$(git stash) # remove the comment hash only when you want to stash any changes you make along the way