Skip to content

Instantly share code, notes, and snippets.

View RabeDatta's full-sized avatar
Open to Work

Rabe Datta RabeDatta

Open to Work
View GitHub Profile
@nimone
nimone / Carousel.jsx
Last active March 24, 2025 03:56
Build a carousel component like instagram purely in ReactJS and TailwindCSS
@KolbySisk
KolbySisk / rhf-form-with-zod.jsx
Created January 17, 2022 16:33
React Hook Form with Zod Example
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import * as z from "zod";
const schema = z.object({
email: z.string().email().min(2),
password: z.string().min(6)
});
export default function RhfFormWithZod() {

Configure prettier, eslint, husky (pre commit hook), lint-staged in react + typescript project

Steps to configure prettier, eslint, husky (pre commit hook), lint-staged in react + typescript project created using create-react-app. This is opinionated configuration with airbnb's style guide as the base style guide.

Step 1 :: Setup prettier

1.1) Install prettier as dev dependency.

npm install --save-dev --save-exact prettier
@kapiljhajhria
kapiljhajhria / JEST_VITE_APP.md
Created October 19, 2021 13:25
Integrate Jest & React Testing Library in a React Vite Project.

Integrate Jest & React Testing Library in a React Vite Project

  1. Install Dependencies
yarn add --dev jest babel-jest @babel/preset-env @babel/core @babel/plugin-syntax-jsx @babel/preset-react @testing-library/dom @testing-library/jest-dom @testing-library/react @testing-library/user-event babel-preset-react-app identity-obj-proxy jest-circus jest-scss-transform jest-watch-typeahead
  1. Set Jest & babel configs in package.json
"jest": {
    "roots": [
@j-bullard
j-bullard / App.tsx
Created July 4, 2021 07:15
Headless UI with React Hook Forms
import "./styles.css";
import { Person } from "./types";
import { Listbox } from "./listbox/listbox";
import { useForm } from "react-hook-form";
const people: Person[] = [
{ id: 1, name: "Durward Reynolds", unavailable: false },
{ id: 2, name: "Kenton Towne", unavailable: false },
{ id: 3, name: "Therese Wunsch", unavailable: false },
{ id: 4, name: "Benedict Kessler", unavailable: true },
@mnghn07
mnghn07 / gitCommitEmoji.md
Created August 10, 2020 10:32
Git Commit Message Emoji
@esouthren
esouthren / index.js
Created May 7, 2020 12:09
Hacking with Amazon Alexa
/*
* Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
@MiyacoGBF
MiyacoGBF / 01_NieR_FAR.md
Last active March 19, 2025 23:38
How to Install FAR, HD Texture Pack, and ReShade (GShade) for NieR:Automata on Linux
@andrejsharapov
andrejsharapov / container.scss
Created December 4, 2019 10:02
sass mixin to container (responsive)
.container {
position: relative;
margin: 0 auto;
padding-right: 1rem;
padding-left: 1rem;
width: 100%;
@include mq(sm) {
max-width: $col-sm;
}
@Merott
Merott / tailwind-colors-as-css-variables.md
Last active March 6, 2025 04:33
Expose Tailwind colors as CSS custom properties (variables)

This is a simple Tailwind plugin to expose all of Tailwind's colors, including any custom ones, as custom css properties on the :root element.

There are a couple of main reasons this is helpful:

  • You can reference all of Tailwind's colors—including any custom ones you define—from handwritten CSS code.
  • You can define all of your colors within the Tailwind configuration, and access the final values programmatically, which isn't possible if you did it the other way around: referencing custom CSS variables (defined in CSS code) from your Tailwind config.

See the Tailwind Plugins for more info on plugins.