Skip to content

Instantly share code, notes, and snippets.

View agrittiwari's full-sized avatar
🏠
Working from home

Agrit Tiwari agrittiwari

🏠
Working from home
View GitHub Profile
@agrittiwari
agrittiwari / send-push.js
Created May 5, 2025 09:15
Implementing Push Notifications on web using service worker
//backend code
import webPush from "web-push";
import { Prisma } from "@prisma/client";
export type PushNotificationData = {
to: string | string[];
webPushSub: Prisma.JsonValue | Prisma.JsonArray;
title: string;
body: string;
data: {
@agrittiwari
agrittiwari / RadioButton.tsx
Last active October 17, 2023 11:08
Example for Abstracted - React Native Paper Radio Button Styling
import * as React from 'react'
import {StyleSheet, View, Text, ViewStyle,} from 'react-native'
import {RadioButton as RButton} from 'react-native-paper'
type RadioButtonProps = {
variant?: 'label-in-line' | 'label-as-title'
label: string
firstValue: string
secondValue: string