Code

I alternate between Atom, Sublime Text 3 (on my local machine) and Vim (on a remote/headless server) for my programming/word-processing/writing needs. My Packages/User/ folder (sublime’s equivalent of a dotfile) can be found here. (requires Package Control). The packages I currently use are here.

I currently use a Dell Inspiron 15 7559 running Ubuntu 16.04 LTS as my primary work machine. My dotfiles (for zsh, vim, tmux, e/spacemacs etc) are in a git repository that can be found here, and installed using this shell script.

This page lists programs I’ve written to directly/indirectly aid research as well as various programming projects.

Stata

Utilities Package

Github Repository

To install, run the following line in the Stata console:

net install lal_utilities, from(https://raw.github.com/apoorvalal/misc_stata_ados/master/)

Or, if you prefer, download ados and move to your personal ado folder / c(sysdir_personal) (where ssc-installed ados live).

R

Utilities Package

Github Repository

To install, run:

library(devtools)
devtools::install_github("apoorvalal/LalRUtils")

Script to install Econometrics/General Data-Munging libraries on R

Atom R engine

R syntax package for Atom (includes bugfixes for the original)

Python

Parallelize stata

(i.e. run several instances of stata in batch mode with separate arguments passed to a do file.

Scrape lecture notes

Download linked files(typically pdfs) that match specified pattern from a static website. Write .txt file with list of links and run download if the scrape_urls fails (as it often does for fancier non-static websites)

Gist Link

Function Plotter

Plots functions in R2 and R3 Gist link

Bash Scripts

dotfiles, massive list of aliases (effectively bash/zsh functions using Pandoc/R/Python/Pweave for a variety of tasks) stored here

Clean install of Anaconda (Ipython + python scientific libraries)

Clean install of R

Clean install of Julia

Autohotkey

Autohotkey is a powerful scripting language for Windows. I’ve written/forked/collected keyboard mappings for programs I use frequently to map as closely as possible to my sublime/vim mappings.

Keyboard Remaps

Remap Caps Lock to CTRL and Right Alt to Esc

Program-specific Keymappings

Adobe Reader

Greek Letters for Math

Google Chrome

Pandoc/R/$\LaTeX$ Templates for working papers, presentations, etc

All templates

github repo

tex, markdown, rmarkdown, python, and R templates for uni work/research.

  • Directory goes in ~/Templates so that new documents can be created using the context menu.
  • Document templates depend on sty and boilerplate files in boilerplate.

Working directory structure and custom pandoc template

github repo

  • paper.md is language agnostic (use for stata/matlab based projects)
  • rmd-paper.Rmd uses Rmarkdown and a custome template lal-paper-template.tex
    • forked from Steve Miller’s template, which implements nifty features such as hyperlinks to footnotes and citations
    • added option to have separate title page septitle in yaml boilerplate
    • added option to centre-align title titlecentre in yaml boilerplate
    • added fancyheaders and added parameter to title paper fancy-header in boilerplate - comment out to restore non-fancy page layout
  • pweave for python pending

for papers using rmarkdown, plain R files can be extracted using:

library(knitr); knitr::purl('file.Rmd')

Includes placeholder directories for code, data, figures, and tables.

Configuration in bash

Define a function in ~/.aliases as follows

# paper template
paperstruct() {
    git clone git@github.com:apoorvalal/alal-markdown-paper-template.git $1
    cd $1 
    rm .git -rf
    mv rmd-paper.Rmd $1.Rmd 
    mv rmd-paper.tex $1.tex
}
alias papeR='paperstruct'

then clone by simply doing papeR <papertitle>