Skip to content

Instantly share code, notes, and snippets.

View divyanshusahu's full-sized avatar
💬
Divyanshu is typing

Divyanshu Sahu divyanshusahu

💬
Divyanshu is typing
View GitHub Profile
@divyanshusahu
divyanshusahu / gitworktree.sh
Last active August 26, 2025 14:57
One command to open git repo in another branch
# Add this in your .zshrc/.bashrc
gt() {
if [ -z "$1" ]; then
echo "Usage: gt <branch_name>"
return 1
fi
branch="$1"
repo_root=$(git rev-parse --show-toplevel 2>/dev/null)
@divyanshusahu
divyanshusahu / Heading.js
Created April 4, 2020 17:06
Border animation (react component)
import { motion } from "framer-motion";
function HeroHeading(props) {
let heading_text = props.heading_text;
const variants = {
initial: { y: 30, opacity: 0 },
enter: { y: 0, opacity: 1, transition: { duration: 0.25 } }
};
let character_array = heading_text.split("");
const framer_spans = character_array.map((c, i) => (
@divyanshusahu
divyanshusahu / editor.js
Last active December 12, 2019 14:48
My Code for making an editor using draftjs and some material-ui components.
import {
Editor,
EditorState,
RichUtils,
AtomicBlockUtils,
CompositeDecorator
} from "draft-js";
import Button from "@material-ui/core/Button";
import Icon from "@material-ui/core/Icon";