Skip to content

Instantly share code, notes, and snippets.

View cmgiven's full-sized avatar

Chris Given cmgiven

View GitHub Profile
@cmgiven
cmgiven / maze.es6
Last active August 4, 2016 01:39
An ES6 solution to the challenge: enumerate all configurations of walls within a 4 x 4 grid that would result in a valid maze. In a valid maze, 1. any space must be reachable from any other space and 2. there must be only one path between any two spaces in the maze. This solution can handle up to a 5 x 5 grid.
// Having derived that any valid maze must have one and only one wall emanating
// from each of its inner vertices, we express a given arrangement of walls as
// a bit array with each vertex represented by two bits, corresponding to the
// direction its wall points. The northwest corner of the maze occupies the
// most significant bit, with the remainder of the vertices ordered left to
// right, top to bottom. The represented direction is as follows:
var NORTH = 0b00, // 0
EAST = 0b01, // 1
SOUTH = 0b10, // 2
WEST = 0b11; // 3
@cmgiven
cmgiven / .block
Last active August 20, 2016 02:57
Retina Canvas
license: mit
@cmgiven
cmgiven / .block
Created August 20, 2016 21:21
Eight Queens
license: mit
@cmgiven
cmgiven / .block
Created August 21, 2016 15:04
Cohort Trails
license: mit

Keybase proof

I hereby claim:

  • I am cmgiven on github.
  • I am cmgiven (https://keybase.io/cmgiven) on keybase.
  • I have a public key whose fingerprint is A08A 263C F610 EF95 8CDB 84F0 CF79 B8A5 DDC3 931E

To claim this, I am signing this object:

@cmgiven
cmgiven / aecf_id_load.R
Created December 3, 2016 16:04
AECF Connecting Data Systems, Data Loading
library("dplyr")
options(stringsAsFactors=FALSE)
bhs <- read.csv("Behavioral Health Services.csv") %>%
mutate(
SVC_START_DT = as.Date(SVC_START_DT, "%m/%d/%Y"),
SVC_END_DT = as.Date(SVC_END_DT, "%m/%d/%Y"),
SUBMT_DT = as.Date(SUBMT_DT, "%m/%d/%Y")
)
@cmgiven
cmgiven / bhs_cooccur.R
Created December 3, 2016 22:09
Behavioral Health Event Co-Occurence
library("dplyr")
library("tidyr")
library("cooccur")
options(stringsAsFactors=FALSE)
bhs <- read.csv("Behavioral Health Services - higher grouping.csv") %>%
mutate(
SVC_START_DT = as.Date(SVC_START_DT, "%m/%d/%Y"),
SVC_END_DT = as.Date(SVC_END_DT, "%m/%d/%Y"),
@cmgiven
cmgiven / .block
Created August 10, 2016 15:53
Triangular Scatterplot
license: mit
height: 800
@cmgiven
cmgiven / sample.R
Created December 4, 2017 21:53
Example R worker
install.packages(c("ROracle", "dplyr", "lubridate", "glue", "survival"))
source("R/vacolsConnect.R")
library(dplyr)
library(lubridate)
library(glue)
library(survival)
con <- vacolsConnect()
query <- function (query) { return(dbGetQuery(con, query)) }
@cmgiven
cmgiven / .block
Last active December 22, 2018 14:24
Brushable Scatterplot/Choropleth
license: mit
height: 350