Skip to content

Instantly share code, notes, and snippets.

View souvikinator's full-sized avatar
🤯
building something cool!

Souvik Kar Mahapatra souvikinator

🤯
building something cool!
View GitHub Profile
@souvikinator
souvikinator / ga4-analytics.js
Last active January 11, 2024 12:04
GA4 (Google Analytics) report using api (using service account)
const { BetaAnalyticsDataClient } = require("@google-analytics/data");
const credentials = require("./sa1.json");
const fs = require("fs");
const propertyId = "301145746";
// console.log(credentials);
const numberWithCommas = (x) => {
try {
@souvikinator
souvikinator / guestbook.md
Last active June 7, 2023 11:33
Let's connect! Feel free to drop a hi :)

hello cat

@souvikinator
souvikinator / postgres-cheatsheet.md
Created November 21, 2021 16:35 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@souvikinator
souvikinator / getGitDir.sh
Last active June 6, 2021 07:33
Downloading a specific directory from Github
#!/bin/bash
#usage:
#arg1: directory where you want to save the specific sub dir from repo
#arg2: the repo clone url
#arg3: name of the specific directory
#ex: ./getGitDir.sh <outputdir> <cloneurl> <targetdir>
#get no of args passed
TOTALARGS="$#"
if [[ $TOTALARGS -lt 3 ]]; then