Skip to content

Instantly share code, notes, and snippets.

View gaurangrshah's full-sized avatar
💭
🚀

gshah2020 gaurangrshah

💭
🚀
View GitHub Profile
@gaurangrshah
gaurangrshah / bg-gradient.tsx
Created April 27, 2024 17:35
bg gradient from the codemod hero background converted to jsx
const BGGradient = ({ children }: { children: React.ReactNode }) => {
return (
<>
<svg
viewBox="0 0 1440 720"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className="z-0 fixed h-80dvh w-full overflow-y-scroll rotate-180"
>
<g clipPath="url(#clip0_27_1751)">
@gaurangrshah
gaurangrshah / dev_env_setup.sh
Created March 8, 2024 21:53
Dev Env Setup Scripts.
#!/bin/bash
# Directory containing the scripts (change this to your directory)
scripts_dir="path/to/your/scripts"
# Get all .sh files in the directory
shopt -s nullglob # Allow for no matches in the glob
scripts=("$scripts_dir"/*.sh)
shopt -u nullglob # Disable for other uses
@gaurangrshah
gaurangrshah / Brewfile
Last active March 18, 2024 04:27
freshi-files
#formla
brew 'tree'
brew 'mas'
brew 'git'
brew 'gh'
brew 'postgresql'
brew 'python3'
brew 'tree'
brew 'bash-completion'
@gaurangrshah
gaurangrshah / font-settings.json
Last active April 4, 2024 14:34
Vscode Settings Categories
{
"editor.fontSize": 13,
"editor.fontFamily": "'Operator Mono Medium', 'Fira Code'",
"editor.fontLigatures": true,
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"name": "comment",
"scope": ["comment"],
"settings": {
#!/bin/bash
# Check if the number of arguments is correct
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <file_path> <alias_name>"
exit 1
fi
# Get the arguments
file_path="$1"
@gaurangrshah
gaurangrshah / starfield-canvas.tsx
Created February 16, 2024 05:04
canvas starfield react
'use client';
// modified slightly from: https://medium.com/designly/how-to-create-an-animated-space-stars-background-effect-in-react-next-js-2806b630379c
import { useEffect, useRef } from 'react';
interface Props {
speedFactor?: number;
backgroundColor?: string;
starColor?: [number, number, number];
starCount?: number;
@gaurangrshah
gaurangrshah / docker-compose.yml
Created January 28, 2024 20:35
postgres + adminer setup to complement a nodejs project
version: '3'
services:
db:
image: postgres
restart: always
volumes:
- ./data/db:/var/lib/postgresql/data
ports:
- 5432:5432
@gaurangrshah
gaurangrshah / globals.css
Last active January 27, 2024 22:02
tailwind init
@tailwind utilities;
@tailwind base;
@tailwind components;
@font-face {
font-family: "Geist";
src: url("/assets/fonts/geist/GeistVariableVF.woff2") format("woff2");
font-weight: 100 1000;
}
// @link: https://www.nightprogrammer.com/javascript/how-to-create-a-logger-in-javascript-example/
// @link: https://dmitripavlutin.com/console-log-tips/
const logbaseColor =
'background: #008cf4; color: #ffffff; font-size: 12px; padding: 2px 4px;';
const logErrorColor =
'background: #974855; color: #ffffff; font-size: 12px; padding: 2px 4px;';
export const client = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@gaurangrshah
gaurangrshah / use-css-animation.ts
Last active June 12, 2023 08:04
Chakra-UI hook for quick & easy css animations.
import { keyframes, usePrefersReducedMotion } from '@chakra-ui/react';
/*
* Types
*/
type CSSAnimation = {
keyframes: string;
animation: string;
};