Skip to content

Instantly share code, notes, and snippets.

View charanjit-singh's full-sized avatar
🎯
Focusing

Charanjit Singh charanjit-singh

🎯
Focusing
View GitHub Profile
import Cookies from 'js-cookie';
// Referral cookie name
const REFERRAL_COOKIE_NAME = 'indiekit_referrals';
// Cookie expiration days (45 days)
const COOKIE_EXPIRY_DAYS = 45;
// Max referrals to store
const MAX_REFERRALS = 5;
interface ReferralEntry {
"use client";
import React, { useRef, useState } from "react";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import {
Card,
CardContent,
CardDescription,
CardFooter,
@charanjit-singh
charanjit-singh / parse.ts
Created November 10, 2023 15:08
Rank Math NextHead NextJS Parser
import { Metadata } from "next";
import { Element, Text, htmlToDOM } from 'html-react-parser';
import { OpenGraph } from "next/dist/lib/metadata/types/opengraph-types";
import { Twitter } from "next/dist/lib/metadata/types/twitter-types";
/**
Example Metadata
<meta name="description" content="Create a professional-looking salary slip for your employees starting this month! Learn all about the important details of a salary slip and the format."/>
<meta name="robots" content="follow, index, max-snippet:-1, max-video-preview:-1, max-image-preview:large"/>
<link rel="canonical" href="https://esahayak.io/blog/salary-slips-templates-download-formats-excel-pdf/" />
@charanjit-singh
charanjit-singh / scrape.py
Created March 10, 2021 13:54
Script to scrape RERA Information from Punjab RERA Website ( using multithreading)
import requests
from bs4 import BeautifulSoup
import codecs
import threading
page = ""
f = codecs.open("RERA_PUNJAB_LIST.html","r")
page = f.read()
soup = BeautifulSoup(page, 'html.parser')