Skip to content

Instantly share code, notes, and snippets.

View frne's full-sized avatar

Frank Neff frne

View GitHub Profile
@frne
frne / AwsPredictionEngine.scala
Last active March 20, 2016 12:31
Code Samples - twitterist.org API
package service
import com.amazonaws.services.machinelearning.model.PredictRequest
import model.FeatureSet
import service.util.{AwsMachineLearningServiceProvider, Loggable}
import scala.collection.JavaConverters._
/** Implementation of the [[service.PredictionEngine]] service */
class AwsPredictionEngine extends PredictionEngine with Loggable with AwsMachineLearningServiceProvider {
@frne
frne / keybase.md
Last active October 31, 2018 21:33
keybase.md

Keybase proof

I hereby claim:

  • I am frne on github.
  • I am frne (https://keybase.io/frne) on keybase.
  • I have a public key ASBn48xpd_mqiMLeCT7B3iVP6DtqwE0fMOdLUqcONp_8UAo

To claim this, I am signing this object:

@frne
frne / 90-rat.conf
Last active December 12, 2016 17:48
XUBUNTU ob MacBook Pro
# path: /usr/share/X11/xorg.conf.d/90-rat.conf
Section "InputClass"
Identifier "Mouse Remap"
MatchDevicePath "/dev/input/event*"
MatchProduct "Mad Catz Mad Catz R.A.T.7 Mouse"
Option "AutoReleaseButtons" "13 14 15"
Option "Buttons" "17"
Option "YAxisMapping" "10 11"
Option "ZAxisMapping" "4 5 6 7"
Option "Emulate3Buttons" "no"
@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)
@frne
frne / BankHolidays.kt
Created January 26, 2023 11:15
Example implementation of Swiss Bank Holidays in Kotlin
import BankHoliday.Companion.isBankHoliday
import java.time.LocalDate
import java.time.Year
fun main(args: Array<String>) {
// some tests (should be done using JUnit of course ;)
mapOf(
LocalDate.of(2023, 1, 1) to true,
LocalDate.of(2023, 8, 1) to true,
@frne
frne / option.ts
Created February 8, 2024 08:59
Function TS Option type
export abstract class Option<T> {
protected value: T | null;
static of<T>(value: T | null): Option<T> {
if (value == null) {
return new None();
} else {
return new Some(value);
}
}