Skip to content

Instantly share code, notes, and snippets.

View andreaskaempf's full-sized avatar

Andreas Kaempf andreaskaempf

View GitHub Profile
@andreaskaempf
andreaskaempf / GetICAO.scala
Created June 13, 2017 01:23
Quick script to get ICAO codes from JSON files
// Read all JSON files in the current directory
val d = spark.read.json("*.json")
// Do the SQL query to get all ICAO codes for the US
d.registerTempTable("crap")
val regs = sql("select distinct Icao from crap where Cou = 'United States'")
// Save to a CSV file
regs.write.csv("US_transmitting_ICAO_codes")
@andreaskaempf
andreaskaempf / gist:428c733345c7569bc399
Created November 3, 2014 09:49
Blending server-side with in-browser analytics
JavaScript makes it possible to run sophisticated quantitative models in the browser, but sometimes things need to run on the server. I'd like to describe an approach I've been using that transparently and fluidly bridges the best of both worlds, using an example from credit card marketing.