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
[email protected] | |
[email protected] | |
[email protected] | |
[email protected] | |
[email protected] | |
[email protected] | |
[email protected] | |
[email protected] | |
[email protected] | |
[email protected] |
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
var gulp = require('gulp'); | |
var Server = require('karma').Server; | |
gulp.task('test', function (done) { | |
new Server({ | |
configFile: __dirname + '/karma.conf.js', | |
singleRun: true | |
}, done).start(); | |
}); |
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
sudo apt-get install libgnome-keyring-dev | |
cd /usr/share/doc/git/contrib/credential/gnome-keyring | |
sudo make | |
sudo ln -s /usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring /usr/lib/git-core/ |
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
module.exports = { | |
config: { | |
// default font size in pixels for all tabs | |
fontSize: 14, | |
// font family with optional fallbacks | |
fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace', | |
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk) | |
cursorColor: 'rgba(248,28,229,0.8)', |
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
case class BigString(value: String) extends AnyVal | |
def getClob(rs: ResultSet, i: Int): BigString = { | |
val clob = rs.getClob(i) | |
val str = Source.fromInputStream(clob.getAsciiStream).mkString | |
BigString(str) | |
} | |
def setClob(ps: PreparedStatement, i: Int, bs: BigString): Unit = { | |
val reader = new StringReader(bs.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
package com.example.websocketdownload | |
import cats.effect.IO | |
import me.tongfei.progressbar.{ProgressBar => pBar} | |
import fs2.{Sink, Stream} | |
import cats.implicits._ | |
class ProgressBar(value: pBar) { | |
def start(): IO[Unit] = IO { |
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] | |
name = "desertest" | |
version = "0.1.0" | |
authors = ["Keir Lawson <[email protected]>"] | |
edition = "2018" | |
[dependencies] | |
serde = { version = "1.0", features = ["derive"] } | |
serde_yaml = "0.8" |
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 streamGen[A](gen: Gen[A]): Stream[IO, A] = Stream.repeatEval(IO(gen.sample)).flatMap(Stream.fromOption(_)) | |
def generateTestFile[A : Arbitrary : Encoder](file: fs2.io.file.Path, items: Long): IO[Unit] = { | |
val values = streamGen(Arbitrary.arbitrary[A]) | |
val jsons = values.map(Encoder[A].apply).take(items) | |
val lines = Stream("[\n") ++ jsons.map(_.toString()).intersperse(",\n") ++ Stream("]") | |
lines | |
.through(text.utf8.encode) | |
.through(Files[IO].writeAll(file)) |