Skip to content

Instantly share code, notes, and snippets.

View balachia's full-sized avatar

Tony Vashevko balachia

View GitHub Profile
@balachia
balachia / pandoc-internalref.hs
Created September 16, 2014 03:16
Pandoc filter that cleans up internal references to figures and tables.
{-
Pandoc filter that cleans up internal references to figures and tables.
It's an attempt to deal with: https://github.com/jgm/pandoc/issues/813
Compile with:
ghc --make pandoc-internalref.hs
and use in pandoc with
--filter [PATH]/pandoc-internalref
@balachia
balachia / gist:ae2d307a392ee6b3286b
Created November 18, 2014 20:03
Instrumental variables with backdoors break everything, even when you know control for the backdoor.
rm(list=ls())
set.seed(1)
n <- 1000
b <- as.matrix(c(1,1))
xb <- 1
zb <- 1
library(data.table)
library(ggplot2)
rm(list=ls())
#set.seed(1)
# solver parameters
eps <- 1e-2 # need an epsilon for the root finder
mingap <- 0.3
@balachia
balachia / CapsLockCtrlEscape.ahk
Created June 6, 2018 11:14 — forked from sedm0784/CapsLockCtrlEscape.ahk
AutoHotkey script to map Caps Lock to Escape when it's pressed on its own and Ctrl when used in combination with another key, à la Steve Losh. Adapted from one that does something similar with the Ctrl Key on the Vim Tips Wiki (http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows?oldid=32281). (Plus contribs from @randy909 & @mmikeww.)
g_LastCtrlKeyDownTime := 0
g_AbortSendEsc := false
g_ControlRepeatDetected := false
*CapsLock::
if (g_ControlRepeatDetected)
{
return
}