Skip to content

Instantly share code, notes, and snippets.

<div
className="absolute inset-x-0 top-1/2 -z-10 -translate-y-1/2 transform-gpu overflow-hidden opacity-10 blur-3xl"
aria-hidden="true"
>
<div
className="ml-[max(50%,38rem)] aspect-[1313/771] w-[82.0625rem] bg-gradient-to-tr from-[#ea580c] to-[#fdba74]"
style={{
clipPath:
"polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%)",
}}
<div id="vidtoquiz" className="relative mt-24">
<script
type="application/json"
>
{"quizId": "dc22f3e2-3281-4425-85ce-7f8702bf852e"}
</script>
<script
type="text/javascript"
src="https://assets.vidtoquiz.com/vidtoquiz-widget.js"
></script>
@sonipranjal
sonipranjal / use-upload-stuff.ts
Created June 8, 2024 20:45
use upload stuff hook -- s3
import { useState } from "react";
import axios from "axios";
import { toast } from "sonner";
import { api } from "@/utils/api";
const useUploadStuff = () => {
const [isUploadLoading, setIsUploadLoading] = useState(false);
const [uploadProgress, setUploadProgress] = useState(0);
const getUploadSignedUrl = api.storageRouter.getUploadSignedUrl.useMutation();
import shutil, tempfile, modal, uuid, os, boto3, ffmpeg, logging
from enum import Enum
from pydantic import BaseModel
from typing import Optional, Dict, List, Any
from concurrent.futures import ThreadPoolExecutor, as_completed
app_image = (
modal.Image.debian_slim()
.apt_install("ffmpeg")
.pip_install("ffmpeg-python", "boto3")
@sonipranjal
sonipranjal / google-sign-in.tsx
Created September 24, 2023 15:10
Supabase + Expo + Google Sign In
// go to supabase dashboard -> into auth -> url config -> put the Redirect URLs as [your-scheme]://google-auth
import * as WebBrowser from "expo-web-browser";
WebBrowser.maybeCompleteAuthSession();
const extractParamsFromUrl = (url: string) => {
const parsedUrl = new URL(url);
const params = parsedUrl.searchParams; // Using searchParams instead of splitting on "#"
@sonipranjal
sonipranjal / db-design.sql
Created April 21, 2023 17:37
this is the db for ultimate twitter clone
-- Create a table for public profiles
create table profiles (
id uuid references auth.users on delete cascade not null primary key,
updated_at timestamp with time zone default timezone('utc'::text, now()) not null,
username text unique,
full_name text,
constraint username_length check (char_length(username) >= 3)
);
-- Set up Row Level Security (RLS)
@sonipranjal
sonipranjal / index.haml
Created August 29, 2019 18:56
No Questions Asked Form & Magic Focus
%form.form{action: ''}
%p.field.required
%label.label.required{for: 'name'} Full name
%input.text-input#name{type: 'text', name: 'name', required: true, value: 'Use Tab'}
%p.field.required.half
%label.label{for: 'email'} E-mail
%input.text-input#email{type: 'email', name: 'email', required: true}
%p.field.half
%label.label{for: 'phone'} Phone