As configured in my dotfiles.
start new:
tmux
start new with session name:
import PyPDF2 | |
import os | |
BASEDIR = os.path.abspath(os.path.dirname(__file__)) | |
pdfdirectory = input("Pease provide pdf directory name : ") | |
user_pass = input("Pease provide password to protect pdf file : ") | |
PDFDIR = os.listdir(f"{BASEDIR}/{pdfdirectory}/") | |
def set_password(): |
/* | |
This script inspired by -> https://gist.github.com/debarko/45995919e2dc13d741b75215d393800d | |
Thanks to Debarko De. | |
It might be not working on an older browser. | |
Change the pincodes to your needs as per your city. | |
How To setup Video -> https://www.youtube.com/watch?v=3_N5FFegtI4 | |
Steps to use | |
1. Update Pincode eg. ['110001', '110002'] and update age e.g 25 |
#!/bin/bash | |
# make sure you have 'ffmpeg & youtube-dl' installed. | |
# Create Video clip from youtube video | |
read -p "Enter Url to Create Video Clip : " URL | |
read -p "Enter start time in HH:MM:SS format : " start_time | |
read -p "Enter duration in seconds from start time : " duration | |
read -p "Enter Video Clip name with .mp4 extension : " filename |
#!/bin/bash | |
BASE_URL='https://www.mxplayer.in' | |
# GET LIST OF LINKS | |
links=$(curl -s https://www.mxplayer.in/browse/live-tv | grep -Eoi '<a [^>]+>' | | |
grep -Eo 'href="[^\"]+"' | grep -Eoi '\/live-tv\/.*' | grep -v '\-live-channels"$' | sed 's/\"//g') | |
# SELECT CHANNEL USING ROFI | |
link=$(echo ${links} | sed -e 's/\s/\n/g' | sed "s|^|$BASE_URL|g" | rofi -dmenu "live channel : ") | |
# GET M3U8 LINK | |
play=$(curl -s ${link} | tr "," "\n" | grep -E '(^\"contentUrl\":\"https:\/\/llvod\.mxplay).*(.m3u8)' | \ |
#!/bin/bash | |
BASE_URL="https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/calendarByPin" | |
date=$(date +%d-%m-%Y) | |
while getopts p: flag | |
do | |
case "${flag}" in | |
p) pincode=${OPTARG};; | |
esac |
#!/bin/bash | |
search_base_url="https://www.jiosaavn.com/api.php?__call=autocomplete.get&_format=json&_marker=0&cc=in&includeMetaTags=1&query=" | |
song_details_base_url="https://www.jiosaavn.com/api.php?__call=song.getDetails&cc=in&_marker=0%3F_marker%3D0&_format=json&pids=" | |
while getopts q: flag | |
do | |
case "${flag}" in | |
q) query=${OPTARG};; | |
esac |
As configured in my dotfiles.
start new:
tmux
start new with session name:
As configured in my dotfiles.
h - Move left
j - Move down
k - Move up
l - Move right
$ - Move to end of line
TLDR: Use for...of
instead of forEach
in asynchronous code.
Array.prototype.forEach
is not designed for asynchronous code. (It was not suitable for promises, and it is not suitable for async-await.)
For example, the following forEach loop might not do what it appears to do: