Skip to content

Instantly share code, notes, and snippets.

View Allysh0w's full-sized avatar
🏠
Working from home

Allyson Martins Allysh0w

🏠
Working from home
View GitHub Profile
@foamdino
foamdino / DefaultS3Service.scala
Last active January 31, 2020 21:57
download s3 files scala/alpakka
package service
import java.time.LocalDate
import akka.NotUsed
import akka.stream.Attributes.LogLevels
import akka.stream.alpakka.csv.scaladsl.{CsvFormatting, CsvQuotingStyle}
import akka.stream.alpakka.s3.scaladsl.S3
import akka.stream.alpakka.s3.{ListBucketResultContents, MultipartUploadResult}
import akka.stream.scaladsl.{Sink, Source}
@erangaeb
erangaeb / broadcast.scala
Created February 3, 2019 02:25
broadcast akka streams
def broadcast() = {
// source with list, list element contains[(String, Int)]
val langs: List[(String, Int)] = List(("Scala", 5), ("Golang", 8), ("Haskell", 7), ("Erlang", 5))
val source = Source(langs)
// two flows
// 1. to extract name from list element[(String, Int)]
// 2. to extract rate from list element[(String, Int)]
val nameFlow = Flow[(String, Int)].map(_._1)
val rateFlow = Flow[(String, Int)].map(_._2)
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active June 30, 2025 07:03
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@erikerlandson
erikerlandson / annotation.md
Last active March 18, 2020 17:49
Monads for using break and continue in scala for comprehensions

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@steinybot
steinybot / Downloader.scala
Last active September 17, 2020 19:59
Akka Stream and HTTP download resource examples
import java.io.File
import akka.http.javadsl.model.headers.ContentDisposition
import akka.http.scaladsl.Http
import akka.http.scaladsl.client.RequestBuilding
import akka.http.scaladsl.model.{HttpResponse, Uri}
import akka.stream.scaladsl._
import akka.stream.{Graph, Materializer, SinkShape}
import akka.util.ByteString
package org.apache.mahout.examples
import org.apache.mahout.drivers._
import org.apache.mahout.math.cf.SimilarityAnalysis
object RecommenderDriver extends MahoutDriver {
/**
* @param args Command line args, if empty a help message is printed.
*/
override def main(args: Array[String]): Unit = {
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"