Skip to content

Instantly share code, notes, and snippets.

View vizowl's full-sized avatar

Chris Knox vizowl

  • Wellington, New Zealand
  • X @vizowl
View GitHub Profile
library(tidyverse)
library(rvest)
library(jsonlite)
library(rlang)
all_csvs <-
read_html("https://www.stats.govt.nz/large-datasets/csv-files-for-download/") |>
html_element('#pageViewData') |>
html_attr('data-value') |>
parse_json() |>
name country rank year years value lastValue
WE Maclagan (GB/Scot) 1 1900 1878-1891 29 29
W Bancroft (Wales) 2 1900 1890-1899 27 27
JA Gould (Wales) 3 1900 1885-1897 27 27
RG MacMillan (GB/Scot) 4 1900 1887-1897 24 24
C Reid (Scot) 5 1900 1881-1888 21 21
JB Brown (Scot) 6 1900 1879-1886 19 19
J Hannan (Wales) 7 1900 1888-1895 19 19
S Lee (Ire) 8 1900 1891-1898 19 19
CV Rooke (Ire) 9 1900 1891-1897 19 19
name country rank year years total lastValue
WE Maclagan (GB/Scot) 1 1900 1878-1891 29 29
W Bancroft (Wales) 2 1900 1890-1899 27 27
JA Gould (Wales) 3 1900 1885-1897 27 27
RG MacMillan (GB/Scot) 4 1900 1887-1897 24 24
C Reid (Scot) 5 1900 1881-1888 21 21
JB Brown (Scot) 6 1900 1879-1886 19 19
J Hannan (Wales) 7 1900 1888-1895 19 19
S Lee (Ire) 8 1900 1891-1898 19 19
CV Rooke (Ire) 9 1900 1891-1897 19 19

Keybase proof

I hereby claim:

  • I am vizowl on github.
  • I am vizowl (https://keybase.io/vizowl) on keybase.
  • I have a public key ASAX3ENQzsYJAR9EiTLVGrrb1LKeW9R9TXsuC4ZSdl-Ckwo

To claim this, I am signing this object:

git clone https://github.com/nzherald/elm-d3-insights.git
cd elm-d3-insights
mkdir XXXX
git archive HEAD | (cd !$; tar xf -)
cd !$ # or cd XXXX
# (!$ is a bash shortcut to the last word of the previous command)
yarn # or npm install
yarn dev # or npm start dev
@vizowl
vizowl / Main.hs
Created July 20, 2017 02:54
List objects in bucket via amazonks
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Lens
import Network.AWS
import Network.AWS.S3
main :: IO ()
main = do
e <- newEnv Discover <&> set envRegion Sydney
@vizowl
vizowl / .zshrc
Last active August 22, 2016 02:25
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
export WORKON_HOME=$HOME/.virtualenvs
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="bureau"
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@vizowl
vizowl / makefile
Last active August 29, 2015 14:16
Makefiles that use container restarting to persist intermediates and targets
CID := .container
CONTAINER = $(shell cat $(CID) 2>/dev/null)
all: out.png
out.png: run/*
ifneq "$(CONTAINER)" ""
docker restart $(CONTAINER)
docker attach $(CONTAINER) || docker logs $(CONTAINER)
else
@vizowl
vizowl / makefile
Created February 27, 2015 01:45
Volume based makefile for docker containers with dependency management
DATAVOL := docker-tutorial-data-container
all: out.png
out.png: run/* .datavol
docker run --rm --volumes-from=$(DATAVOL) -w /work -v $$PWD/run:/work \
-v /output ipython/scipystack make $(MFLAGS)
docker cp $(DATAVOL):/output/out.png .
.datavol:
docker run --name $(DATAVOL) -v /output debian