Skip to content

Instantly share code, notes, and snippets.

View nikdata's full-sized avatar
:octocat:

Nik Agarwal nikdata

:octocat:
View GitHub Profile
@nikdata
nikdata / new-mac-setup.md
Last active January 9, 2023 04:52
My Preferred Apps for Apple Silicon Mac

The basic steps are:

  • Configuration
    • ZSH
    • SSH
    • Git
  • Applications
    • Brew
    • iTerm2
  • R/RStudio
@nikdata
nikdata / shiny-module-example.R
Last active July 23, 2021 22:56
Simple Shiny Module Example with Dependent Dropdowns and Tab Dependent Condition
# Load libraries
library(shiny)
library(dplyr)
library(tidyr)
library(ggplot2)
library(palmerpenguins)
# data used for minimium reproducible example (reprex)
df <- penguins %>%
tidyr::drop_na() %>%

Google AI Platform Notebook tips

AI Notebooks vs Colab

Google Colab: https://colab.research.google.com/

  • Free compute! and interesting, fixed cost, 10$/month Google Colab Pro version.
  • Notebooks are very easy to share, with ability to control permissions (integration in google drive/doc ecosystem).
  • Instant availability. No requirement other than a regular google account.
  • Idle time limit : 1h in free version.
@nikdata
nikdata / fetch-wsj-xword.R
Created February 1, 2021 01:56
Get latest Wall Street Journal (WSJ) crossword
fetch_xwd <- function(date) {
if(missing(date)) {
cur_date <- Sys.Date()
} else {
cur_date <- date
}
dayofweek <- as.character(lubridate::wday(cur_date, label = TRUE))
@nikdata
nikdata / reticulate-example.R
Created January 27, 2021 02:51
Using {reticulate}
library(reticulate)
library(palmerpenguins)
library(dplyr)
library(ggplot2)
library(extrafont)
df_pgs <- palmerpenguins::penguins
dplyr::glimpse(df_pgs)