Skip to content

Instantly share code, notes, and snippets.

@prithwi
prithwi / conda-env-list.sh
Created January 25, 2022 21:08
List conda environments with creation date.
#!/bin/bash
# ref: https://stackoverflow.com/a/57682857
# uses both system and local conda environment
conda_folders=( `conda info --base`/envs $HOME/.conda/envs )
echo "==> Creation Date <== Environment Name"
echo "#"
for folder in "${conda_folders[@]}"; do
for env_hist in "$folder"/*/conda-meta/history; do
@prithwi
prithwi / NY_quarantinedstates.ipynb
Last active October 5, 2020 19:00
Quarantined States for NY
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@prithwi
prithwi / LatexNotes.md
Last active August 27, 2020 21:11
Simple tricks to add notes to latex margins

todonotes provides a nice method to add notes in latex document in the margin. However, it doesn't work properly with latex documents with muli-level \input statements (eg. inputing a tex in another tex file that was inputted in the main file).

A simple solution is to use the following package:

\usepackage{marginnote}  % to add notes to margins
\usepackage{amssymb}     % for special latex symbols
\usepackage{xcolors}     % for more broader range of latex colors
@prithwi
prithwi / snippets.md
Last active January 31, 2019 21:14
Handy tidbits

Handy snippets for misc. use

Latex

Handy commands for i.e., e.g. and et al.

\newcommand{\etal}{\textit{et al}.\ }
\newcommand{\ie}{\textit{i}.\textit{e}.\ }
\newcommand{\eg}{\textit{e}.\textit{g}.\ }
@prithwi
prithwi / Parse_KDD_2018.ipynb
Created June 1, 2018 12:30
Notebook to parse list of accepted KDD papers
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@prithwi
prithwi / SO_34598339.ipynb
Created January 4, 2016 20:27
daily stock to weekly stock values
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@prithwi
prithwi / get_cdc_historical.py
Created December 4, 2015 18:39
Script to collect historial cdc data
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author : Prithwish Chakraborty <prithwi@vt.edu>,
# Bryan Lewis <blewis@vbi.vt.edu>
# date : 2015-09-21
# LICENSE: MIT
"""
Code to get historical CDC data
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Prithwish Chakrabory <prithwi@vt.edu>
# LICENSE: MIT
# date: 2015-09-01
"""
Code to find country from lat-lon using shapefile
@prithwi
prithwi / grids_from_shpfile.py
Last active February 23, 2016 00:42
Get all lat/lon from shapefile that are within a shape
#!/usr/bin/env python
# encoding: utf-8
# Author: Prithwish Chakrabory <prithwi@vt.edu>
# LICENSE: MIT
# date: 2015-09-01
"""
Code to extract lat lon from a shapefile that fills a grid.