Skip to content

Instantly share code, notes, and snippets.

View Koushikphy's full-sized avatar
🎯
Focusing

Koushik Naskar Koushikphy

🎯
Focusing
View GitHub Profile
@Koushikphy
Koushikphy / checkAcronym.py
Created November 8, 2023 09:34
List all acronyms and/or keywords in your documents to avoid duplicate acronym definitions
import re,sys,subprocess
from colorama import init as colorama_init, Fore, Style
colorama_init()
keywords = [
# provide keywords
]
@Koushikphy
Koushikphy / bash_promp.sh
Created June 8, 2023 03:26
My bash prompt to show datetime as well as git repo details
# My bash prompt to show datetime as well as git repo details
. /etc/bash_completion.d/git-prompt
export GIT_PS1_SHOWDIRTYSTATE=1
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h \[\e[36m\][\D{%H:%M:%S %d-%b}]\[\e[m\]\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\033[0;33m$(__git_ps1 " (%s)")\033[0m\$ '
@Koushikphy
Koushikphy / style.css
Created April 21, 2023 03:22
notion style to remove upper portion of a page
.notion-page-controls[style*='margin-top: 80px;']{
margin-top: 0px !important;
}
.notion-record-icon.notranslate.notion-focusable{
margin-top: 0 !important;
}
.whenContentEditable> div:nth-child(3){
display: none;
}
@Koushikphy
Koushikphy / screen.sh
Last active June 13, 2023 06:13
Take and show screenshot from remote machine
takes(){ # pass remote machine
case "$1" in
test) DIS_NUM='1' ;;
*) DIS_NUM='0' ;;
esac
ssh $1 "cd ~/Downloads; DISPLAY=:$DIS_NUM scrot screenshot.png"
fName=~/Downloads/.scr/screen_$(date -d "today" +"%Y_%m_%d=%H_%M").png
rsync -q $1:~/Downloads/screenshot.png $fName --remove-source-files
xdg-open $fName
@Koushikphy
Koushikphy / Readme.md
Created September 23, 2022 14:57
Download all videos of any YouTube playlist

Open the playlist page in a browser and open the developer console and paste this JS code

var tmpLink = document.createElement('a');
tmpLink.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(
    [...document.querySelectorAll("a#video-title")].map(e => {
        let link = e.getAttribute('href')
        let onlyLink = "https://www.youtube.com/" + link.split("&")[0]
        return onlyLink
    }).join("\n"))
);
@Koushikphy
Koushikphy / SaveAsPDF.dotm
Created April 22, 2022 13:38
Save a doc in PDF with same name in same place
Sub MacroSaveAsPDF()
'macro saves pdf either in the same folder where active doc is or in documents folder if file is not yet saved
'
Dim strPath As String
Dim strPDFname As String
strPDFname = ActiveDocument.Name
strPDFname = Left(strPDFname, InStr(strPDFname, ".") - 1)
If strPDFname = "" Then 'user deleted text from inputbox, add default name
strPDFname = "example"
@Koushikphy
Koushikphy / animatedLogin.html
Created May 19, 2020 06:50
Animated login screen without JS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
label {
display: block;
}