Skip to content

Instantly share code, notes, and snippets.

View lucasrpb's full-sized avatar
🎯
Focusing

Lucas Batistussi lucasrpb

🎯
Focusing
View GitHub Profile
@stonegao
stonegao / rest.scala
Created October 9, 2011 16:05 — forked from robi42/rest.scala
Basic RESTful service with Finagle
class Respond extends Service[Request, Response] with Logger {
def apply(request: Request) = {
try {
request.method -> Path(request.path) match {
case GET -> Root / "todos" => Future.value {
val data = Todos.allAsJson
debug("data: %s" format data)
Responses.json(data, acceptsGzip(request))
}
case GET -> Root / "todos" / id => Future.value {
@deekayen
deekayen / 1-1000.txt
Last active May 10, 2025 11:15
1,000 most common US English words
the
of
to
and
a
in
is
it
you
that
@hdubugras
hdubugras / gist:9985111
Last active August 29, 2015 13:58
VAGA DESENVOLVEDOR BACK-END Pagar.me

VAGA DESENVOLVEDOR BACK-END

O Pagar.me está crescendo e o nosso time também. Para isso, estamos contratando desenvolvedores para nos ajudar a resolver os grandes problemas do mercado de pagamentos brasileiro. Nossa aplicação é escrita principalmente em Javascript (Node.js e AngularJS) e somos fortemente adeptos a novas tecnologias. Adoramos usar as ferramentas certas para resolver nossos problemas e somos totalmente obcecados por testes e filosofia open-source.

Não procuramos pessoas apenas excepcionais em Javascript, Ruby ou outra linguagem, mas também em computação em si. Queremos gente apaixonada por UNIX, otimização (incluindo do seu editor de texto), testes, segurança e consistência. Amamos os que programam desde a adolescência ou infância e que não consigam dormir até resolver um problema.

Seguem algumas reportagens sobre o pagar.me e os fundadores:

@travisbrown
travisbrown / SimpleHttpServer.java
Last active March 2, 2017 02:49
A very simple Finagle HTTP server example (no error handling, etc.)
import com.twitter.finagle.Http;
import com.twitter.finagle.ListeningServer;
import com.twitter.finagle.Service;
import com.twitter.finagle.http.HttpMuxer;
import com.twitter.util.Await;
import com.twitter.util.Future;
import java.net.InetSocketAddress;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.jboss.netty.buffer.ChannelBuffers.copiedBuffer;
import org.jboss.netty.handler.codec.http.*;
@Asitha
Asitha / GetLeaderNode.java
Created September 4, 2015 12:28
Code snippet to return the leader node in a Hazelcast cluster.
public boolean isLeader() {
// Get all the Hazelcast instances in the current JVM.
// In case of carbon server this is always either one
// or zero.
Iterator<HazelcastInstance> iter
= Hazelcast.getAllHazelcastInstances().iterator();
if (iter.hasNext()) { // cluster mode
@dcaoyuan
dcaoyuan / akka-http-client.scala
Created August 26, 2016 12:23
akka-http-client-example
val uri = "http://www.yahoo.com"
val reqEntity = Array[Byte]()
val respEntity = for {
request <- Marshal(reqEntity).to[RequestEntity]
response <- Http().singleRequest(HttpRequest(method = HttpMethods.POST, uri = uri, entity = request))
entity <- Unmarshal(response.entity).to[ByteString]
} yield entity
val payload = respEntity.andThen {
@sanjid133
sanjid133 / Install etcd On Ubuntu 16.04.md
Last active March 23, 2021 09:33
Install etcd On Ubuntu 16.04/18.04
#!/bin/bash
ETCD_VERSION=${ETCD_VERSION:-v3.3.1}
curl -L https://github.com/coreos/etcd/releases/download/$ETCD_VERSION/etcd-$ETCD_VERSION-linux-amd64.tar.gz -o etcd-$ETCD_VERSION-linux-amd64.tar.gz
tar xzvf etcd-$ETCD_VERSION-linux-amd64.tar.gz
rm etcd-$ETCD_VERSION-linux-amd64.tar.gz
cd etcd-$ETCD_VERSION-linux-amd64
@davideicardi
davideicardi / README.md
Last active June 22, 2020 04:39
Alpakka Kafka connector (akka-stream-kafka) example. Produce and consumer kafka messages using Akka Stream.

Alpakka Kafka connector (akka-stream-kafka) example

Simple solution to use Alpakka Kafka connector to produce and consume kafka messages.

I assume that you have 2 scala apps, a producer and a consumer.

Producer

Add the following dependencies: