Skip to content

Instantly share code, notes, and snippets.

# command_for_r
# $r_exec --no-save --no-restore --verbose
# N:/.../script.R
# inp_file = 'input.dta'
# inp_dir - 'D:/input/'
# working = 'D:/working/'
# dep_var = 'tot_grouped_cost'
# rhs_vars = c('age ')
# cmd: 2>&1
; ############################ AHK Greek Letters.ahk >
; Uses (CTRL & ALT & SHIFT & alphabetic keyboard keys) to send lowercase Greek letters to your text editor
+^!a::Send {U+03B1} ; α - alpha
+^!b::Send {U+03B2} ; β - beta
+^!g::Send {U+03B3} ; γ - gamma
+^!d::Send {U+03B4} ; δ - delta
+^!e::Send {U+03B5} ; ε - epislon
+^!z::Send {U+03B6} ; ζ - zeta
@apoorvalal
apoorvalal / sumatra_settings.txt
Created August 18, 2017 16:51
sumatra settings for dark mode
# For documentation, see http://www.sumatrapdfreader.org/settings3.2.html
MainWindowBackground = #80fff200
EscToExit = false
ReuseInstance = false
UseSysColors = false
RestoreSession = true
FixedPageUI [
TextColor = #ffffff
@apoorvalal
apoorvalal / plotter.py
Created October 4, 2017 00:47
visualise functions in R2 and R3 in python
# In[1]:
import os,sys,glob
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# run for jupyter notebook
# get_ipython().magic('matplotlib notebook')
# from IPython.core.interactiveshell import InteractiveShell
# InteractiveShell.ast_node_interactivity = "all"
@apoorvalal
apoorvalal / normalize_spaces.py
Last active December 14, 2017 18:08
Normalize spaces before importing as dataframes
#%%
import os
import re
os.chdir('data_directory')
raw_files = [x for x in os.listdir()]
for raw in raw_files:
inputfile = raw
outputfile = raw.split('.')[0]+'_clean.txt'
library(lfe)
library(stargazer)
set.seed(6152011)
# Number of cities
L <- 1000
# Number of industries
K <- 3
@apoorvalal
apoorvalal / stata_summary.R
Created February 21, 2018 16:20 — forked from leeper/stata_summary.R
Stata-style regression summaries
stata_summary <-
function(
x,
...
) {
# summarize
mod <- x
x <- summary(x)
# find outcome variable
@apoorvalal
apoorvalal / pdf2png.sh
Created February 23, 2018 16:43
converts pdfs in folder to png
#!/bin/bash
for pdfile in *.pdf ; do
convert -verbose -density 500 -resize '800' "${pdfile}" "${pdfile%.*}".png
done
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.