Skip to content

Instantly share code, notes, and snippets.

View SivaramPg's full-sized avatar
🧱
Building

Sivaram Pandariganthan SivaramPg

🧱
Building
View GitHub Profile
@SivaramPg
SivaramPg / gold_silver_rates.php
Created November 8, 2025 08:31 — forked from surferxo3/gold_silver_rates.php
Gold and Silver Rates API to fetch updated rates with their respective currency and price.
<?php
/*#############################
* Developer: Mohammad Sharaf Ali
* Designation: Web Developer
* Version: 2.0
*
* Changes from Version 1.0:
* - Updated to use a new API endpoint that returns JSON data instead of plain text
* - Replaced file_get_contents with cURL for improved error handling and performance
@SivaramPg
SivaramPg / VERCEL_SUBMODULE_SETUP.md
Created June 30, 2025 07:57
This guide explains how to configure Vercel to clone private Git submodules during deployment.

Vercel Private Submodule Setup Guide

This guide explains how to configure Vercel to clone private Git submodules during deployment.

Overview

Our approach combines the best practices from Timmy O'Mahony's blog post with improvements for better maintainability and error handling.

Key Features

@SivaramPg
SivaramPg / base-css.md
Created April 21, 2024 05:00 — forked from cassidoo/base-css.md
Base CSS for a plain HTML document

If you don't want to deal with styling a mostly text-based HTML document, plop these lines in and it'll look good:

html {
  font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-size: 1.3em;
  max-width: 40rem;
  padding: 2rem;
  margin: auto;
 line-height: 1.5rem;
@SivaramPg
SivaramPg / script.ts
Created March 29, 2024 12:33
Reading the contents of a directory using Bun
// https://bun.sh/docs/api/glob
import { Glob } from 'bun'
const glob = new Glob('./raw/json/*.json')
for (const file of glob.scanSync('.')) {
console.log(file)
}
@SivaramPg
SivaramPg / command.md
Created March 29, 2024 12:31
Clone the latest revision of a git repository of a particular branch only

Useful for large projects or occasions where you just need to check something out quickly without downloading everything from a repository

git clone --depth=1 --single-branch --branch=<branch_name_here> <git_repo_url_here>
@SivaramPg
SivaramPg / swapi.ts
Last active March 29, 2024 04:24
Using Star Wars APIs (Swapi.info)
// TO Explore all the available APIs on SWAPI.INFO, please visit the explorer
// https://swapi.info
const SWAPI_BASE_URL = 'https://swapi.info/api'
async function fetchSwapiData(url) {
try {
const response = await fetch(url)
const data = await response.json()
return data
@SivaramPg
SivaramPg / .env.local
Last active March 29, 2024 04:15
Drizzle + Turso Setup & Configuration
TURSO_DATABASE_URL="..."
TURSO_AUTH_TOKEN="..."
@SivaramPg
SivaramPg / Web3Provider.tsx
Last active March 28, 2024 16:21
Initial Connectkit setup in a Next.js project
import { WagmiProvider, createConfig, http } from "wagmi";
import { mainnet } from "wagmi/chains";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { ConnectKitProvider, getDefaultConfig } from "connectkit";
const config = createConfig(
getDefaultConfig({
// Your dApps chains
chains: [mainnet],
transports: {
@SivaramPg
SivaramPg / _redirects
Created March 28, 2024 16:18
Handling 404 Page not found errors on Netlify SPA deployments. Add this `_redirects` file in the public folder of your SPA to be bundled inside the output once built.
/* /index.html 200
@SivaramPg
SivaramPg / docker-compose.yml
Created March 28, 2024 16:13
Developing ElysiaJS application in Docker
# docker-compose.yml
version: '3.9'
services:
app:
image: "oven/bun"
# override default entrypoint allows us to do `bun install` before serving
entrypoint: []
# execute bun install before we start the dev server in watch mode
command: "/bin/sh -c 'bun install && bun run --watch src/index.ts'"