Skip to content

Instantly share code, notes, and snippets.


Curtis Alexander curtisalexander

View GitHub Profile

Excel Tables and VBA

It's 2020, and there's now many ways to work with data of arbitrary length in Excel:

  • Power Query's M language
  • JavaScript
  • dynamic arrays.

But if you use or support older Excel versions, VBA can still be useful.

HQJaTu / trigger-Azure-CDN-certificate-update.ps1
Created Jun 18, 2019
Azure CDN certificate update trigger
View trigger-Azure-CDN-certificate-update.ps1
#Requires -Version 6.0
The MIT License (MIT)
Copyright (c) 2019 Jari Turkia (
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
CMCDragonkai / stay-awake.ps1
Last active Sep 21, 2020
Keep Windows Awake Temporarily (Prevent Sleep, Display Off or Away Mode) #cli #powershell #windows
View stay-awake.ps1
#!/usr/bin/env powershell
# This script can keep the computer awake while executing another executable, or
# if no executable was passed in, then it stays awake until this script stops.
# There are 3 different ways of staying awake:
# Away Mode - Enable away mode (
# Display Mode - Keep the display on and don't go to sleep or hibernation
# System Mode - Don't go to sleep or hibernation
# The default mode is the System Mode.
# Away mode is only available when away mode is enabled in the advanced power options.
cdhunt / map_fold.ps1
Created Oct 27, 2016
Map and Fold implementations in Powershell
View map_fold.ps1
function map([scriptblock]$map, [Collections.IEnumerable]$x, $y) { $x.ForEach({& $map $_ $y}) }
# Two parameters
map { param($x, $y) $x + $y } @(1,2,3) 10
# Anonymous function as a value
$squareIt = { param($x) $x + $x }
map $squareIt @(1,2,3)
# One parameter
View drought_anim.r
library(albersusa) # devtools::install_github("hrbrmstr/albersusa")
library(spdplyr) # devtools::install_github("mdsumner/spdplyr")
library(ggplot2) # devtools::install_github("hadley/ggplot2")
View monetdblite-demo.R
# rm -r /tmp/hmda
dbdir <- "/tmp/hmda"
con <- dbConnect(MonetDBLite::MonetDBLite(), dbdir)
# download at
dd <- readRDS("/tmp/hmda.rds")
dannguyen /
Last active Nov 23, 2020
Transcribing ProPublica podcast with Python and Watson Speech to Text API

Using IBM Watson Speech to Text API to translate a ProPublica podcast

An example of using the Watson Speech to Text API to translate a podcast from ProPublica: How a Reporter Pierced the Hype Behind Theranos

This is just a simpler demo of the same technique I demonstrate to make automated video supercuts in this repo:

The transcription takes just a few minutes (less if you parallelize the requests to IBM) and is free...but it isn't perfect by any means. It doesn't fare super well on proper nouns:

  • Charles Ornstein's last name is transcribed as Orenstein
  • John Carreyrou's last name becomes John Kerry Roo
ttscoff / dontforget.bash
Last active Oct 18, 2022
Quick reminders from Terminal (bash)
View dontforget.bash
# dontforget
# A stupid script for short term reminders in bash
# Arguments just need to contain a number and a bunch of words.
# The number can be anywhere in the arguments, but there shouldn't
# be any other numeric digits.
wch / lmgadget.R
Created Jan 20, 2016
Shiny Gadget example: lmGadget
View lmgadget.R
# Example usage:
# lmGadget(mtcars, "wt", "mpg")
# Returns a list with two items:
# $data: Data with excluded rows removed.
# $model: lm (model) object.
lmGadget <- function(data, xvar, yvar) {
View database_visualization.R
## Install packages if you don't already have them
install.packages(c("stringr", "igraph"), dependencies = TRUE)
## Load the packages
## Read in the data
queries <- read.csv("~/Downloads/queries.csv")
tables <- read.csv("~/Downloads/tables.csv")