Skip to content

Instantly share code, notes, and snippets.

Avatar
🚋
Taking preparation for exam

KasRoudra KasRoudra

🚋
Taking preparation for exam
View GitHub Profile
View 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 / exception_handler.py
Last active May 22, 2022
Exception handler for both python2 and python3
View exception_handler.py
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 / r2n.js
Created May 12, 2022
ReactJS to NextJS Converter
View r2n.js
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
Create React Functional Component (including javascript and css) with just one command "create"
View create.sh
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 / react-build.ipynb
Last active Dec 18, 2021
React-Build.ipynb
View react-build.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.