Skip to content

Instantly share code, notes, and snippets.

View prirai's full-sized avatar
💭
Exploring

Priyanshu Kumar Rai prirai

💭
Exploring
View GitHub Profile
@prirai
prirai / config.fish
Created March 4, 2025 19:16
My Fish configuration
if status is-interactive
end
function fish_greeting
echo -n "Hello friend! "
set hour (date +%H)
if test $hour -lt 4
echo -n 🌃
else if test $hour -lt 12
echo -n 🌅
@prirai
prirai / smart_ranker.sh
Created February 15, 2025 13:30
Smarter ranking for pacman mirrors, based on delay and mirror score. (need to have curl and rankmirrors installed)
#!/bin/bash
default_delay=3600
default_score=10
read -p "Enter delay (default: $default_delay, lower is better): " delay
read -p "Enter score (default: $default_score, lower is better): " score
delay=${delay:-$default_delay}
score=${score:-$default_score}
Ever worried about being able to easily transfer subscriptions from yt to newpipe but not back? Deleted some and added some more subscriptions and then want to go back to the official youtube app for a bit? I made a bash script where you input the both files (yt CSV and newpipe json), and it tells you what changed, which subs deleted and which ones added. [source](https://prirai.github.io/blog/newpipe-to-youtube/)
@prirai
prirai / cs_cheat_sheet.txt
Created August 13, 2023 07:35 — forked from alexkuhl/cs_cheat_sheet.txt
Computer Science "Cheat Sheet"
This "cheat sheet" is designed to be a super-high level view of common and/or important computer science concepts. Good for test reviews, preparing for job interviews, brushing up on the basics, becoming a better person, or light reading for putting your significant other to sleep. I will continue to update this so if you have any suggestions or corrections please send a pull request or contact me. Licensed under http://creativecommons.org/licenses/by-sa/3.0/.
Algorithms
+ Limiting behavior (all the second sections are as limit(n)->infinity)
* Big O - f is bounded by g :: f(n) <= g(n)*c (for some constant c) :: an upper bound, can be much higher than actual performance because this is not a tight bound, for example a log(n) algorithm technically is O(n!) but is obviously way better than something that actually gets n! performance
* Small or Little o - f dominated by g :: f(n) < g(n)*c; f(n)/g(n) = 0 :: g gets much larger
* Big Omega - f is bounded below by g :: |f(n)| >= g(n)*c :: a lower bound, bu
{
"meta": {
"theme": "elegant"
},
"basics": {
"name": "Priyanshu Rai",
"label": "BS Engineering Sciences at IISER Bhopal",
"image": "https://prirai.github.io/assets/img/mylogo.png",
"email": "[email protected]",
"phone": "",