Skip to content

Instantly share code, notes, and snippets.

View rahulspace's full-sized avatar
🚴‍♂️
Speed up

Rahul rahulspace

🚴‍♂️
Speed up
View GitHub Profile
alias gits='git status'
alias gita='git add'
alias gitaa='git add .'
alias gitc='git commit -m'
alias gitl='git log'
alias gitb='git branch'
alias gitch='git checkout'
alias gitr='git reset HEAD^'
alias gitph='git push origin'
alias gitpl='git pull origin'

React js

Create element

const e = React.createElement;

Create component

@rahulspace
rahulspace / Random Color Generator.js
Created September 19, 2022 08:41
Random Color Generator JavaScript
export default {
generate() {
var letters = "BCDEF";
var color = "#";
for (var i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * letters.length)];
}
return color;
},
};
@rahulspace
rahulspace / gist:c936425045ef078f9c60ad3813e18e39
Created June 1, 2024 05:17
Tilt React Component Move Using Framer Motion - Tilt Children On Mouse
// components/Tilt.js
import React, { useState, useEffect } from "react";
import { motion } from "framer-motion";
const Tilt = ({ children }) => {
const [mousePosition, setMousePosition] = useState({ x: window.innerWidth / 2, y: window.innerHeight / 2 });
useEffect(() => {
const handleMouseMove = (e) => {
setMousePosition({