This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.spark.{AccumulableParam, SparkConf} | |
import org.apache.spark.serializer.JavaSerializer | |
import scala.collection.mutable.{ HashMap => MutableHashMap } | |
/* | |
* Allows a mutable HashMap[String, Int] to be used as an accumulator in Spark. | |
* Whenever we try to put (k, v2) into an accumulator that already contains (k, v1), the result | |
* will be a HashMap containing (k, v1 + v2). | |
* | |
* Would have been nice to extend GrowableAccumulableParam instead of redefining everything, but it's |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def myDependencyVersion(scalaVersion: String) = scalaVersion match { | |
case "2.11.11" => "2.0" | |
case _ => "1.0" | |
} | |
Project(...) | |
.settings( | |
libraryDependencies ++= Seq( | |
..., | |
"my" %% "dependency" % myDependency(scalaVersion.value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install bass (https://github.com/edc/bass) to be able to use bash utilities in Fish | |
fisher add edc/bass | |
touch ~/.config/fish/functions/sdk.fish | |
# paste content in ~/.config/fish/functions/sdk.fish, then save | |
function sdk | |
bass source ~/.sdkman/bin/sdkman-init.sh ';' sdk $argv | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import date, datetime, time, timedelta | |
import json | |
import os | |
import shutil | |
from urllib import parse, request | |
from urllib.error import HTTPError | |
import yaml | |
def get_new_access_token(ctx): |