Skip to content

Instantly share code, notes, and snippets.

@devalls
devalls / sports-tracker-download.js
Created December 14, 2017 21:25 — forked from anonymous/sports-tracker-download.js
Download all workouts from sports-tracker
// based entirely on this blog post:
// http://druss.co/2016/04/export-all-workouts-from-sports-tracker/
// unfortunately the original script no longer works, moslty because jQuery is
// no longer available on sports-tracker pages.
//
// I've compiled the changes proposed in the comments in the script below.
// to use the script, login to your sports-tracker account
// change URL to http://www.sports-tracker.com/diary/workout-list
// open browser console (Cmd-Shift-I)
@frne
frne / Schema2CaseClass.scala
Last active May 6, 2022 20:23
Spark DataFrame Schema to Scala Case Class Generator
object Schema2CaseClass {
import org.apache.spark.sql.types._
case class RecFieldRes(fieldStr: String, additionalCc: Option[String] = None)
case class CcRes(cc: String, additional: List[String])
def schema2Cc(schema: StructType, className: String): String = {
val res = CcRes(s"case class $className (\n", Nil)