Skip to content

Instantly share code, notes, and snippets.

View KasRoudra's full-sized avatar
🚋
Taking preparation for exam

Roudra Sarker KasRoudra

🚋
Taking preparation for exam
View GitHub Profile
@KasRoudra
KasRoudra / react-build.ipynb
Last active December 18, 2021 11:23
React-Build.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@KasRoudra
KasRoudra / r2n.js
Created May 12, 2022 08:21
ReactJS to NextJS Converter
const fs = require("fs");
const path = require("path");
const react2next = (startPath = "./", extension = "js") => {
let notFound = true;
const recursive = (startPath, extension) => {
const ext = "." + extension;
const files = fs.readdirSync(startPath);
for (let i = 0; i < files.length; i++) {
const relPath = (dir) => path.join(startPath, dir);
@KasRoudra
KasRoudra / create.sh
Last active May 15, 2022 16:39
Create React Functional Component (including javascript and css) with just one command "create"
crc() {
if [ -z "$1" ]; then
echo "Usage: crc <Component>"
return 1
fi
file=`echo ${1} | awk '{ print toupper(substr($0, 1, 1)) substr($0, 2) }'`
folder=`echo ${1} | awk '{ print tolower(substr($0, 1, 1)) substr($0, 2) }'`
if [[ -d ${1} || -d ${folder} || -d ${file} ]]; then
echo "Already Exists!"
return 1
@KasRoudra
KasRoudra / exception_handler.py
Last active May 22, 2022 09:43
Exception handler for both python2 and python3
from sys import exc_info, version_info
from os.path import abspath
blue = "\033[0;34m"
white ="\033[0;37m"
red = "\033[0;31m"
error = "{}[{}!{}] {}".format(blue, white, blue, red)
def exception_handler(e, multiline=False):
lines_arr = []
@KasRoudra
KasRoudra / react-start.ipynb
Created June 20, 2022 11:24
React-Start.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@KasRoudra
KasRoudra / macify.sh
Created December 30, 2022 15:44
Make your linux look like macos
# Color snippets
black="\033[0;30m"
red="\033[0;31m"
bred="\033[1;31m"
green="\033[0;32m"
bgreen="\033[1;32m"
yellow="\033[0;33m"
byellow="\033[1;33m"
@KasRoudra
KasRoudra / vnc.sh
Created December 30, 2022 15:56
Automate vnc setup
echo "Installing tigervnc....."
sleep 1
sudo pacman -S tigervnc
clear
echo "Set your password for VNC..."
sleep 2
vncpasswd
display=$(xdpyinfo | awk '/dimensions/{print $2}')
sessions=$(ls /usr/share/xsessions)
desktop_sessions=$(echo "$sessions" | grep -E "plasma|gnome|xfce|lxqt|cinnamon|mate")
@KasRoudra
KasRoudra / doom-emacs.sh
Created December 30, 2022 16:04
Automate doom emacs configuration
# Install GNU Emacs
sudo pacman -S emacs
git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.emacs.d
~/.emacs.d/bin/doom install
~/.emacs.d/bin/doom sync
echo "
[Unit]
Description=Emacs Daemon
After=syslog.target network.target
@KasRoudra
KasRoudra / nvdm
Created December 30, 2022 16:09
Neovim distributions manager
#!/usr/bin/env bash
# Color snippets
black="\033[0;30m"
red="\033[0;31m"
bred="\033[1;31m"
green="\033[0;32m"
bgreen="\033[1;32m"
yellow="\033[0;33m"
byellow="\033[1;33m"
@KasRoudra
KasRoudra / volume.sh
Created September 18, 2023 05:45
A termux volume controller built for cronjobs
#!/bin/bash
min() {
for stream in $(termux-volume | jq -r ".[].stream"); do
termux-volume $stream 0
done
echo "Mode: Silent"
termux-toast "Mode: Silent"
}