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 com.twitter.util.{Future => TwFuture} | |
import scala.concurrent.{Future => ScFuture, promise => ScPromise} | |
implicit def twFutureToScala[T](twFuture: TwFuture[T]): ScFuture[T] = { | |
val prom = ScPromise[T] | |
twFuture.onSuccess { res: T => | |
prom.success(res) | |
} | |
twFuture.onFailure { t: Throwable => | |
prom.failure(t) | |
} |
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
trait HTree | |
case class HTNode[T, LT <: HTree,RT <: HTree](node:T, lt:LT, rt:RT ) extends HTree | |
case class HTNil() extends HTree | |
/* | |
exmaple: | |
scala> HTNode ( 1, HTNode("a",HTNode(1.0,HTNil(),HTNil()), HTNode('z',HTNil(),HTNil())), HTNode(List(1,2,3),HTNil(),HTNil())) |
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
var fs = require('fs'), | |
util = require('util'), | |
_path = require('path'); | |
var sourceFolder = 'sourceFolder', | |
playlistPath = 'sync.m3u', | |
destinationFolder = 'destFolder'; | |
console.log('-- Playlist copy application --\n'); | |
console.log('Copying from ' + sourceFolder + ' to ' + destinationFolder + '\n'); |
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
# Source accepts the protocol s3:// with the host as the bucket | |
# access_key_id and secret_access_key are just that | |
s3_file "/var/bulk/the_file.tar.gz" do | |
source "s3://your.bucket/the_file.tar.gz" | |
access_key_id your_key | |
secret_access_key your_secret | |
owner "root" | |
group "root" | |
mode 0644 | |
end |