View SparkExampleTests.scala
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
package com.example | |
import utest._ | |
object SparkExampleTests extends TestSuite { | |
import scala.util.{Try,Success,Failure} | |
import org.apache.spark.sql.SparkSession | |
val _spark: Try[SparkSession] = | |
Try { |
View Configs.scala
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
//file: project/Configs.scala | |
import sbt._ | |
object Configs { | |
val FunctionalTest = config("ft") extend (Test) | |
val AcceptanceTest = config("at") extend (Test) | |
val PerformanceTest = config("pt") extend (Test) | |
val Tools = config("tools") extend (Test) | |
} |
View sbt_disable_publishing.sbt
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 disablePublishing: Seq[Setting[_]] = | |
Seq( | |
publish/skip := true, | |
publishLocal/skip := true | |
) |
View SlickConfig.scala
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
trait SlickConfig { | |
import scala.util.{Try, Success, Failure} | |
private val RegexDB2 = "^jdbc:(db2):.*//(.*):(.*)/([^;]*)[?:;](.*)".r | |
private val RegexDerby = "^jdbc:(derby):.*//(.*):(.*)/([^;]*)[?:;](.*)".r | |
private val RegexH2 = "^jdbc:(h2):(?:mem):()()([^;]*)[?:;](.*)".r | |
private val RegexHsqlDB = "^jdbc:(hsqldb):.*//(.*):(.*)/([^;]*)[?:;](.*)".r | |
private val RegexSqlServer = "^jdbc:(sqlserver)://(.*):(.*);DatabaseName=([^;]*)[?:;](.*)".r | |
private val RegexjTDS = "^jdbc:(jtds):sqlserver://(.*):(.*)/([^;]*)[?:;](.*)".r | |
private val RegexMySQL = "^jdbc:(mysql):.*//(.*):(.*)/([^;]*)[?:;](.*)".r |
View sequence.scala
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 scala.util.{Try,Success,Failure} | |
def sequence[T](seq: Seq[Try[T]]): Try[Seq[T]] = | |
seq | |
.foldRight(Try(List.empty[T])) { | |
case (item, acc) => for { a <- acc; i<- item } yield i :: a | |
} |
View yaml_solve_references.rs
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
#![allow(unused_parens)] | |
use anyhow::{Context,Result, anyhow}; | |
use clap::{arg, App, AppSettings}; | |
use std::ffi::OsStr; | |
fn main() -> Result<()> { | |
let matches = App::new("mkvm") | |
.about("Make virtual machines easily!") | |
.setting(AppSettings::SubcommandRequiredElseHelp) |
View kvm_host_network_interfaces
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
## /etc/network/interfaces | |
# This file describes the network interfaces available on your system | |
# and how to activate them. For more information, see interfaces(5). | |
source /etc/network/interfaces.d/* | |
# The loopback network interface | |
auto lo | |
iface lo inet loopback |
View ElanTabletWACOM.txt
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
Section "InputClass" | |
Identifier "Wacom driver override" | |
MatchProduct "ELAN2514:00 04F3:2B05" | |
MatchDevicePath "/dev/input/event*" | |
Driver "wacom" | |
EndSection |
View linalg.sh
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
#!/bin/bash -eu | |
function linalg_matrix_dump { | |
local -n M=${1} | |
local -a data=(${M[data]}) | |
typeset -i rows=${M[rows]} | |
typeset -i cols=${M[cols]} | |
typeset -i i j | |
printf "%s:\n" ${1} | |
for ((i=0;i<rows;i++)) ; do |
View github_clone_user.py
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
#!/usr/bin/env python3 | |
import json | |
import requests | |
import argparse | |
import os | |
import sys | |
from git import Repo | |
## |
NewerOlder