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 FileProps { | |
def size: Long | |
} | |
val vfs: FileSystem = ??? | |
def readFlux(path: Path): Future[(FileProps, SFlux[Buffer])] = | |
vfs.propsFuture(path.toString).map { vertxFileProps => | |
val props = new FileProps { | |
override def size = vertxFileProps.size() |
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 'dart:io'; | |
import 'package:functional_data/functional_data.dart'; | |
import 'package:meta/meta.dart'; | |
import 'package:zowo_lib/lib.dart'; | |
part 'Config.g.dart'; | |
@immutable | |
@FunctionalData() |
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 app.utils | |
import java.io.{FileReader, Reader} | |
import java.nio.file.Path | |
import java.security.cert.Certificate | |
import java.security.{KeyStore, Security} | |
import javax.net.ssl.{KeyManagerFactory, SSLContext, TrustManagerFactory} | |
import org.bouncycastle.asn1.pkcs.PrivateKeyInfo | |
import org.bouncycastle.cert.X509CertificateHolder |
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 app.utils | |
import java.io.{File, FileOutputStream, RandomAccessFile} | |
import cats.effect.{ConcurrentEffect, IO} | |
import com.typesafe.scalalogging.Logger | |
import fs2._ | |
import fs2.concurrent.Queue | |
import net.sf.sevenzipjbinding._ | |
import net.sf.sevenzipjbinding.impl.RandomAccessFileInStream |
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
class MyDBContext( | |
dataSource: DataSource with Closeable, | |
ec: ExecutionContextWithExecutor | |
) extends PostgresJdbcContext(SnakeCase, dataSource) | |
with Queries with Quotes with JsonB with Codecs |
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 zowo_shared.lib.compat | |
import kotlinx.collections.immutable.ImmutableCollection | |
import kotlinx.collections.immutable.ImmutableSet | |
import kotlinx.collections.immutable.PersistentMap | |
import kotlinx.collections.immutable.persistentMapOf | |
import zowo_shared.lib.functional.ZOption | |
interface ICompatPersistentMap<K, V> { | |
val entries: ImmutableSet<Map.Entry<K, V>> |
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
https://github.com/tinylabproductions/tlplib/commit/3d96ea5e6d90d168ea41bc0d2470c7b2d86b74b0 |
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 java.nio.charset.StandardCharsets | |
import java.nio.file.{Files, Path, Paths} | |
case class Identifier(ticker: String, isin: String) | |
val DescriptionRe = """^(.+?)\s*\((.+?)\).*$""".r | |
def read(path: Path): Map[Identifier, Vector[BigDecimal]] = { | |
val lines = Files.readAllLines(path, StandardCharsets.UTF_8) | |
var map = Map.empty[Identifier, Vector[BigDecimal]].withDefaultValue(Vector.empty) |
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
using com.tinylabproductions.TLPLib.Data; | |
using Quantum; | |
namespace Game.code.quantum_bind { | |
public static class Conversions { | |
public static unsafe QGuid toQGuid(this SerializableGUID guid) { | |
var srcBytes = stackalloc byte[16]; | |
var dstBytes = stackalloc byte[16]; | |
*((ulong*) srcBytes) = guid.long1; | |
*((ulong*) (srcBytes + 8)) = guid.long2; |
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
// photon does not serialize ulong by default | |
public static readonly IPhotonProperty<QGuid> PROP_USER_ID = | |
PhotonProperty.a(new TypedKey<long>("UserId_p0")) | |
.add( | |
PhotonProperty.a(new TypedKey<long>("UserId_p1")), | |
(l1, l2) => new QGuid((ulong) l1, (ulong) l2), | |
id => (long) id.long1, | |
id => (long) id.long2 | |
); | |