Skip to content

Instantly share code, notes, and snippets.

View rjoydip's full-sized avatar

Joydip Roy rjoydip

View GitHub Profile
import asyncio
import base64
from pathlib import Path
from typing import List, Tuple
import aiofiles
import json
async def png_to_base64_file(png_path: Path, output_dir: Path) -> str:
"""
@rjoydip
rjoydip / compress_video
Created August 24, 2024 00:58 — forked from trvswgnr/compress_video
portable shell script to compress videos with ffmpeg
#!/bin/sh
print_usage() {
echo "usage: compress_video <input_file>"
echo "supported formats: mp4, webm, mkv, mov, avi, flv"
}
get_extension() {
f="${1##*/}"
case "$f" in

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com

@rjoydip
rjoydip / get-all-packages.sh
Last active September 30, 2022 07:18
Extracting name and version property from all package.json under node_modules folder
#!/bin/bash
# Shows versions of node and npm
echo "Node version : $(node -v)"
echo "NPM version : $(npm -v)"
# Variable initialization
comma=","
location="./data"
@rjoydip
rjoydip / git-repo-migration.sh
Created September 6, 2022 07:06
Bash script to move codebase from one GitHub account to another - Required REPO name and description
#!/bin/bash
## Dependency
# - jq
## Example
# ./git-repo-migration.sh <repo_name> <description>
SOURCE_ACCOUNT='rjoydip-zz'