Skip to content

Instantly share code, notes, and snippets.

View alexhallam's full-sized avatar
🚀
Launching Code

Alex Hallam alexhallam

🚀
Launching Code
View GitHub Profile
@alexhallam
alexhallam / init.vim
Created April 23, 2021 20:41
My Nvim Config
" Plugins
call plug#begin('~/.vim/plugged')
Plug 'rakr/vim-one' " vim-one color theme
Plug 'scrooloose/nerdtree' " side bar file tree
Plug 'itchyny/lightline.vim' " minmal status bar
Plug 'tpope/vim-fugitive' " allows git commands in vim session
Plug 'airblade/vim-gitgutter' " shows git changes in gutter
Plug 'easymotion/vim-easymotion' " go to any word quickly '\\w', '\\e', '\\b'
Plug 'KKPMW/vim-sendtowindow' " send commands to REPL
Plug 'yuttie/comfortable-motion.vim' " scrolling 'C-d' or 'C-u'
date key value
2001-10-01 21056643 0
2001-11-01 21056643 0
2001-12-01 21056643 0
2002-01-01 21056643 0
2002-02-01 21056643 1
2002-03-01 21056643 1
2001-10-01 21012606 1
2001-11-01 21012606 1
2001-12-01 21012606 1
We can't make this file beautiful and searchable because it's too large.
date,key,value
1998-01-01,21056643,1
1998-02-01,21056643,0
1998-03-01,21056643,0
1998-04-01,21056643,0
1998-05-01,21056643,0
1998-06-01,21056643,1
1998-07-01,21056643,0
1998-08-01,21056643,0
1998-09-01,21056643,0
ds gid u q
2016-04-25 CA_1_X 0.10 3359.54653112229
2016-04-25 CA_1_X 0.30 3674.8888585185
2016-04-25 CA_1_X 0.50 4447.04529473154
2016-04-25 CA_1_X 0.70 5166.51261258749
2016-04-25 CA_1_X 0.90 5651.46500026313
2016-04-26 CA_1_X 0.10 3359.54653112229
2016-04-26 CA_1_X 0.30 3674.8888585185
2016-04-26 CA_1_X 0.50 4447.04529473154
2016-04-26 CA_1_X 0.70 5166.51261258749
@alexhallam
alexhallam / install_suckless.sh
Last active October 14, 2019 17:08
Debian_Suckless
#!/bin/bash
# Credit
# https://marvin.im/post/a-suckless-debian/
# install basics
apt-get update; apt-get install -y neovim tmux xinit git build-essential wget curl stow alsa-utils &&
# get my dotfiles -- mostly for nvim
https://github.com/alexhallam/dotfiles.git &&
cd dotfiles &&
#!/bin/bash
sudo apt update && sudo apt-get install vim sudo -y \
&& sudo apt-get install git stow -y \
&& sudo adduser $USER sudo \
&& sudo apt install bspwm sxhkd xterm \
suckless-tools feh compton dunst libnotify-bin \
lemonbar xdo acpi gnome-keyring -y \
&& sudo apt remove mate-notification-daemon -y\
&& sudo apt install papirus-icon-theme -y\
&& sudo apt install fonts-firacode fonts-hack \
@alexhallam
alexhallam / Dockerfile
Created September 18, 2019 00:06
Rocker Docker includes odbc
FROM rocker/verse:3.6.0
# install some packages needed for odbc and MS repo
RUN apt-get update && apt-get install -y \
curl \
apt-utils \
apt-transport-https \
debconf-utils \
build-essential \
&& rm -rf /var/lib/apt/lists/*
@alexhallam
alexhallam / summ_error.R
Created April 22, 2019 16:09
summarise with quantile dplyr
test_results %>%
summarise(.estimate = list(enframe(quantile(.error, probs=seq(.10,.90,.05))))) %>%
unnest()
taskscheduleR::taskscheduler_create(taskname = "myfancyscript_5min", rscript = myscript,
schedule = "MINUTE", starttime = "11:19", modifier = 1, startdate = format(as.Date("2019-01-19"), "%m/%d/%Y"))
library(tidyverse)
# naive forecast method example
sales <- tibble(g = c(rep("insample", 23), rep("outsample", 12)),
y = c(0,2,0,1,0,10,0,0,0,2,0,6,3,0,0,0,0,0,7,0,0,0,0, 0, 0, 0, 3, 1, 0, 0, 1, 0, 1, 0, 0),
y_hat = ifelse(g == "insample", lag(y), last(y)),
error = abs(y - y_hat))
sales
sales %>%