Skip to content

Instantly share code, notes, and snippets.

View ShikharVj's full-sized avatar

Shikhar Vijayvergiya ShikharVj

  • Bhopal, M.P., India
View GitHub Profile
@ShikharVj
ShikharVj / db_review.sql
Created November 21, 2024 12:23
The following gist contains the list of Postgres DB queries which can be used to review and identify bottlenecks in the database. These bottlenecks can be large table sizes, sequential scans on tables or unused indexes and much more.
-- Query 1: To identify table and index size for each table
SELECT
relname AS table_name,
pg_size_pretty(pg_total_relation_size(relid)) AS total_size,
pg_size_pretty(pg_table_size(relid)) AS table_size,
pg_size_pretty(pg_indexes_size(relid)) AS indexes_size
FROM pg_catalog.pg_statio_user_tables
ORDER BY pg_total_relation_size(relid) DESC;
@ShikharVj
ShikharVj / apple_secret.go
Last active September 12, 2024 06:02
This Go program generates a JWT for Apple’s "Sign in with Apple" authentication by signing it with an Apple private key downloaded from the developer portal. Ensure that the private key, Team ID, and Client ID are correctly set before use.
package main
import (
"fmt"
"time"
jwt "github.com/golang-jwt/jwt"
)
@ShikharVj
ShikharVj / Go overview.md
Created January 22, 2023 15:55 — forked from BrianWill/Go overview.md
Go language overview for experienced programmers

The Go language for experienced programmers

Why use Go?

  • Like C, but with garbage collection, memory safety, and special mechanisms for concurrency
  • Pointers but no pointer arithmetic
  • No header files
  • Simple, clean syntax
  • Very fast native compilation (about as quick to edit code and restart as a dynamic language)
  • Easy-to-distribute executables