This file contains hidden or 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
| #!/bin/bash | |
| curl -L https://github.com/coreos/etcd/releases/download/v3.3.1/etcd-v3.3.1-linux-amd64.tar.gz -o etcd-v3.3.1-linux-amd64.tar.gz | |
| tar xzvf etcd-v3.3.1-linux-amd64.tar.gz | |
| cd etcd-v3.3.1-linux-amd64 | |
| sudo cp etcd /usr/local/bin/ | |
| sudo cp etcdctl /usr/local/bin/ | |
| etcd --version |
This file contains hidden or 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 org.scalatest.FlatSpec | |
| import scala.concurrent.{Await, Future, Promise} | |
| import scala.concurrent.duration._ | |
| import scala.concurrent.ExecutionContext.Implicits.global | |
| class MainSpec extends FlatSpec { | |
| "accounts balances" should "be equal before and after transfers" in { |
This file contains hidden or 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
| class Test { | |
| private var y = 0 | |
| def x = y | |
| def x_=(v: Int) = y = v | |
| } | |
| val test = new Test() | |
| test.x = 12 |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| type VectorClock struct { | |
| values map[string]int64 | |
| } |
This file contains hidden or 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 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.*; |
This file contains hidden or 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
| .data ## Data declaration section | |
| ## String to be printed: | |
| prompt: .asciiz "Enter a non-negative number:\n" | |
| result: .asciiz "\nThe factorial is: " | |
| .text | |
| main: | |
| li $v0, 4 | |
| la $a0, prompt | |
| syscall |
This file contains hidden or 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
| object Main { | |
| trait A { | |
| val age = 18 | |
| } | |
| trait B { | |
| val name = "Lucas" | |
| } |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| type Action struct { | |
| Next interface{} | |
| f func() | |
| } |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "runtime" | |
| ) | |
| func catchPanic(err *error, functionName string) { | |
| // recover gets the last panic |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "math" | |
| "time" | |
| ) | |
| type Receiver interface { | |
| Receive(data interface{}) |