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
//> using dep "com.lihaoyi::os-lib:0.9.3" | |
import os._ | |
object Tree extends App { | |
def listFiles(path: os.Path, depth: Int = 0): Unit = { | |
if (os.isDir(path)) { | |
for (subPath <- os.list(path)) { | |
println(" " * depth + subPath.last) |
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 BinaryTree(info: String, left: Option[BinaryTree], right: Option[BinaryTree]) | |
object Application extends App { | |
val firstLeftFirstLeft = BinaryTree("firstLeftFirstLeft", None, None) | |
val firstLeftFirstRight = BinaryTree("firstLeftFirstRight", None, None) | |
val firstRightFirstLeft = BinaryTree("firstRightFirstLeft", None, None) | |
val firstLeft = BinaryTree("firstLeft", Some(firstLeftFirstLeft), Some(firstLeftFirstRight)) |
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
--- | |
- hosts: webservers | |
vars: | |
http_port: 80 | |
max_clients: 200 | |
remote_user: root | |
tasks: | |
- name: ensure apache is at the latest version | |
yum: name=httpd state=latest | |
- name: write the apache config file |
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
[india] | |
host1 | |
host2 | |
[japan] | |
host3 | |
host4 | |
[asia:children] | |
India |
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
all: | |
hosts: | |
mail.example.com | |
children: | |
webservers: | |
hosts: | |
foo.example.com: | |
bar.example.com: | |
dbservers: | |
hosts: |
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
[mailservers] | |
mail.example.com | |
[webservers] | |
foo.example.com | |
bar.example.com | |
[dbservers] | |
one.example.com | |
two.example.com |
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
blockchain0 -- bd4824d8ee63fc82392a6441444166d22ed84eaa6dab11d4923075975acab938 | |
blockchain1 -- db0b9c1cb5e9c680dfff7482f1a8efad0e786f41b6b89a758fb26d9e223e0a10 | |
blockchain2 -- 8f0532cd22055fb7599aa48f38501dcd46e61712ab49a02f840f5545830e9260 | |
blockchain3 -- eb61c3724d6da33605084d2d232bba0563cb82f4ad82c101b42f23c2e86277ef | |
blockchain4 -- 1af101f70897bf501779b7b2e413ae7144aba5b97e24890c71ba2a1d9c518d20 |
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 scala.concurrent._ | |
import scala.concurrent.duration._ | |
import akka.actor.{Actor, ActorRef, ActorSystem, Props} | |
import akka.pattern.ask | |
import akka.util.Timeout | |
// KillMe case object to stop an actor | |
case object KillMe |