Skip to content

Instantly share code, notes, and snippets.

View yashsehgal's full-sized avatar

Yash Sehgal yashsehgal

View GitHub Profile
@yashsehgal
yashsehgal / main.py
Created October 15, 2025 08:56
Pattern in Linear Systems: Constant Ratio of Sums of Numerators and Denominators
import random
from fractions import Fraction
def solve_system(n):
"""
Solve the system:
n*x + (n+1)*y = n+2
(n+3)*x + (n+4)*y = n+5
Returns x, y as Fractions
"""
@yashsehgal
yashsehgal / button.tsx
Created October 29, 2024 03:21
customised shadcn button (3d design)
import * as React from 'react';
import { cva, type VariantProps } from 'class-variance-authority';
import { cn } from '@/lib/utils';
import { IconLoader2, TablerIcon } from '@tabler/icons-react';
import { TABLER_ICON_STYLE } from '@/utils/style';
import { motion, MotionProps } from 'framer-motion';
const buttonVariants = cva(
'inline-flex items-center justify-center whitespace-nowrap rounded-xl text-sm font-semibold ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 gap-2 border',
@yashsehgal
yashsehgal / header.js
Created April 6, 2021 20:30
This is a very basic JS-DOM based Header Component
/// Header Component in JavaScript
// Data for the header options
const header_options = [
{
"title": "Home",
"path": "/index.html"
},
{