Skip to content

Instantly share code, notes, and snippets.

View thedivtagguy's full-sized avatar
🤙
I don't know what I'm doing.

Aman Bhargava thedivtagguy

🤙
I don't know what I'm doing.
View GitHub Profile
@thedivtagguy
thedivtagguy / library.r
Created February 12, 2021 07:59
Library Parser
library(shiny)
library(tidyverse)
library(gdata)
library(stringr)
library(readr)
library(gsubfn)
library(waiter)
# Define UI for data upload app ----
gif <- paste0("https://media1.tenor.com/images",
library(shiny)
ui <- fluidPage(
titlePanel("Srishti Library Database"),
# Sidebar layout with input and output definitions ----
library(tidyverse)
library(gdata)
library(stringr)
library(readr)
library(gsubfn)
# Read in File
# This is the fixed file from Excel, but we want to do everything in R
# data <-
# read.csv("D:/Srishti/Year 2 Semester 1/Co-Create/books.csv", header = FALSE)
@thedivtagguy
thedivtagguy / compile.svg
Created February 18, 2021 11:33
Compile IMage
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thedivtagguy
thedivtagguy / artist_genre.r
Last active May 19, 2021 06:53
Genre Search
# Code to search for an artist on Spotify and return their Spotify ID and genres.
# Requires the spotifyR package and for you to be authenticated with Spotify
# Read more here: https://github.com/charlie86/spotifyr
# And here: https://developer.spotify.com
# Extra: Could be adapted for all Spotify Features
library(tidyverse)
library(spotifyr)
# Authentication
Country Value
Republic TV 210300
NDTV 156200
CNN News 18 97286
# calculate long term averages for each month and also calculate week wise anomalies for 2022
from datetime import datetime, timedelta
import os
import numpy as np
import rasterio as rio
from multiprocessing import Pool, cpu_count
# version changed from V06B to V06C on May 8, 2022
dt_version_shift = datetime.strptime("20220508", '%Y%m%d')
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thedivtagguy
thedivtagguy / sheets-to-md.py
Created January 6, 2021 03:39
Converting Google Sheets to Markdown Files
# Takes in a file CSV file and outputs each row as a Markdown file with YAML front matter named after first column.
# Data in the first row of the CSV is assumed to be the column heading.
# Original work borrowed from: https://github.com/EvanLovely/csv_to_jekyll
# Adapted from https://www.bryanklein.com/blog/hugo-python-gsheets-oh-my/
# Import the python libraries.
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from pathlib import Path
import os
@thedivtagguy
thedivtagguy / restore-link-sanity.js
Created October 7, 2023 11:46
TamperMonkey script that restores text and descriptions to Twitter Links