Skip to content

Instantly share code, notes, and snippets.

View abelbryo's full-sized avatar

Abel Terefe abelbryo

View GitHub Profile
object UserEntityModule {
case class UserEntityF[F[_], G[_]](id: G[Option[Long]] = None, username: F[String], password: F[String])
type Id[A] = A
type Forget[A] = Unit
// You can also just use Option if you don't care
// for the domain-specific type
sealed trait Updatable[+A] {
def foreach(f : A => Unit): Unit = this match {
@abelbryo
abelbryo / S3OutputStream.java
Created July 11, 2024 20:03 — forked from blagerweij/S3OutputStream.java
OutputStream which wraps S3Client, with support for streaming large files directly to S3
import java.io.ByteArrayInputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.model.AbortMultipartUploadRequest;
import com.amazonaws.services.s3.model.CannedAccessControlList;
import com.amazonaws.services.s3.model.CompleteMultipartUploadRequest;
import com.amazonaws.services.s3.model.InitiateMultipartUploadRequest;