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
// participation.cpp | |
#include<iostream> | |
using std::cout; | |
using std::endl; | |
void nope() {} | |
void participation() { return nope(); } | |
int main() { | |
participation(); |
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 akka.http.scaladsl.model.HttpMethods._ | |
import akka.http.scaladsl.model.headers.{`Access-Control-Allow-Credentials`, `Access-Control-Allow-Headers`, `Access-Control-Allow-Methods`, `Access-Control-Allow-Origin`} | |
import akka.http.scaladsl.server.directives.RespondWithDirectives | |
trait EnableCORSDirectives extends RespondWithDirectives { | |
private val allowedCorsVerbs = List( | |
CONNECT, DELETE, GET, HEAD, OPTIONS, | |
PATCH, POST, PUT, TRACE | |
) |
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
// build.sbt | |
// "org.http4s" %% "http4s-client" % "0.12.3", | |
// "org.http4s" %% "http4s-blaze-client" % "0.12.3", | |
// "org.http4s" %% "http4s-dsl" % "0.12.3", | |
import org.http4s.MediaType._ | |
import org.http4s.client._ | |
import org.http4s.client.blaze.{defaultClient => client} | |
import org.http4s.dsl._ | |
import org.http4s.headers._ |
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
### Container based on official postgres v9.5.3, with: | |
# * rvm | |
# * ruby 2.2.3 | |
# * rails 4.2.3 | |
### | |
FROM postgres:9.5.3 | |
RUN apt-get update && apt-get install -y curl git libpq-dev | |
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 |
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
// ref: https://github.com/evbruno/flight_delay_akka_streams | |
// ref: https://github.com/evbruno/flight_delay_java8 | |
// 0 : load | |
val flightText = sc.textFile("/tmp/2008.csv").cache | |
case class FlightEvent( | |
year: String, | |
month: String, |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
class CalculadoraFinanciamento : CustomDebugStringConvertible { | |
let valorFinanciado, amortizacao, jurosMensal: Double | |
init(_ valorImovel: Double, valorEntrada: Double, parcelas: Int, jurosMensal: Double) { | |
self.valorFinanciado = valorImovel - valorEntrada |
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 akka.actor.SupervisorStrategy._ | |
import akka.actor.{Actor, ActorLogging, ActorRef, ActorSystem, OneForOneStrategy, Props} | |
import akka.stream.ActorMaterializer | |
import scala.collection.mutable.{Map => MMap} | |
import scala.concurrent.duration._ | |
import scala.io.StdIn | |
object SupervisorSample extends App { |
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
// build.sbt: libraryDependencies += "com.jcraft" % "jsch" % "0.1.54" | |
// docker image with sshd: https://docs.docker.com/engine/examples/running_ssh_service/ | |
package etc.bruno.ssh | |
import akka.actor.{Actor, ActorLogging, ActorRef, ActorSystem, Props} | |
import akka.pattern.{ask, pipe} | |
import akka.util.Timeout | |
import com.jcraft.jsch._ | |
import etc.bruno.ssh.SSHActor._ |
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
``` | |
.------------------+-----------------------------------------------------------------+-----------+--------------------------------------------------+--------+--------------------+----------+----------+----------------+---------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+------------------+----------------------+---------+------------. | |
| |
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 DadosFinanciamento(valorFinanciado: Double, | |
amortizacao: Double, | |
parcelas: Int, | |
jurosMensal: Double) | |
case class ParcelaCalculada(numDaParcela: Int, | |
valor: Double, | |
jurosSobreSaldo: Double, | |
saldoDevedor: Double) { |
OlderNewer