Skip to content

Instantly share code, notes, and snippets.

View lucasrpb's full-sized avatar
🎯
Focusing

Lucas Batistussi lucasrpb

🎯
Focusing
View GitHub Profile
object Main extends App {
// Uma obs: tá vendo que não é necessário declarar que vai retornar String? (o compilador "adivinha" o tipo de retorno)
implicit def int2String(i: Int) = i.toString
var n: String = 2
println(s"""n
Este é um bloco de multiplas linhas de string :P (adoro isso em Scala)
@lucasrpb
lucasrpb / .json
Created September 24, 2015 01:00
{"id":"","username":"lucasrpb","password":"123","email":"lucasbatistussi@gmail.com","code":"49112103-71a2-4d19-bdfe-fcbd92a33498"}
@lucasrpb
lucasrpb / reflection.go
Last active November 22, 2016 21:43
This gist shows how to reflect a struct in GoLang :)
package main
import (
"fmt"
"reflect"
)
type Cep struct {
Number string
}
// GET INFO AT RUNTIME ABOUT SOME INSTANCE
def extractInfo(e: Any): Unit = {
val im = cm.reflect(e)
val tpe = im.symbol.typeSignature.typeSymbol.asType.toType
tpe match {
case t if t <:< typeOf[String] => {
package com.github.lucasrpb.cassandra
import com.datastax.driver.core.querybuilder.Insert
import com.datastax.driver.core.{AbstractGettableData, GettableByNameData, Row}
import scala.collection.mutable
/**
* Created by lucasrpb on 6/17/16.
* Incomplete for some types (but for other types the implementation is analogous)
@lucasrpb
lucasrpb / FinagleHttpServer.scala
Last active August 10, 2016 22:50
Example Finagle Http Service with custom response
import java.nio.ByteBuffer
import com.twitter.finagle.{Http, Service}
import com.twitter.finagle.http.path._
import com.twitter.finagle.http.{MediaType, Method, Request, Response, Status}
import com.twitter.io.Bufs
import com.twitter.util.{Await, Future}
import scala.concurrent.ExecutionContext.Implicits.global
package main
import (
"fmt"
)
type Parenter interface {
super() interface{}
}
c, _ := sender.Send("Hi from Server!")
//fmt.Println(c)
select {
case data := <-c: {
fmt.Println(data)
//return
package main
import (
"fmt"
"bufio"
"os"
"math"
)
type ActorI interface {
@lucasrpb
lucasrpb / IntelliJ_IDEA__Perf_Tuning.txt
Created December 14, 2016 01:23 — forked from P7h/IntelliJ_IDEA__Perf_Tuning.txt
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1