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
U-Boot 2009.08-00088-g121cddc (Nov 17 2014 - 05:50:46) Avocent (0.0.3) EVB, Build: jenkins-idrac-yocto-release-505 | |
CPU: SH-4A | |
BOARD: R0P7757LC00xxRL (C0 step) board | |
BOOT: Secure, HRK not generated | |
DRAM: 240MB | |
(240MB of 256MB total DRAM is available on U-Boot) | |
ENV: Using primary env area. | |
In: serial | |
Out: serial |
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
U-Boot 2009.08-00088-g121cddc (Nov 17 2014 - 05:50:46) Avocent (0.0.3) EVB, Build: jenkins-idrac-yocto-release-505 | |
CPU: SH-4A | |
BOARD: R0P7757LC00xxRL (C0 step) board | |
BOOT: Secure, HRK not generated | |
DRAM: 240MB | |
(240MB of 256MB total DRAM is available on U-Boot) | |
ENV: Using primary env area. | |
In: serial | |
Out: serial |
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
#!/usr/bin/env python3 | |
# Note: depends on `pairtree` package (`pip install pairtree`) | |
import os | |
import pairtree.pairtree_path as ppath | |
def stubby_to_pairtree(path: str, ef_ext: str = '.json.bz2') -> str: | |
assert path.endswith(ef_ext) | |
d, f = os.path.split(path) | |
assert len(d.split(os.sep)) >= 2 |
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 java.time.{Instant, LocalDate, ZoneOffset} | |
import play.api.libs.json._ | |
object JsonImplicits { | |
implicit object LocalDateMongoJsonReaderWriter extends Reads[LocalDate] with Writes[LocalDate] { | |
override def reads(json: JsValue): JsResult[LocalDate] = | |
(json \ "$date").validate[Long].map(Instant.ofEpochMilli(_).atZone(ZoneOffset.UTC).toLocalDate) |
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 java.time.{Instant, LocalDate, ZoneOffset} | |
import reactivemongo.bson._ | |
object BsonImplicits { | |
implicit object LocalDateBsonReaderWriter extends BSONReader[BSONValue, LocalDate] with BSONWriter[LocalDate, BSONDateTime] { | |
override def read(bson: BSONValue): LocalDate = bson match { | |
case BSONDateTime(millis) => Instant.ofEpochMilli(millis).atZone(ZoneOffset.UTC).toLocalDate | |
case BSONLong(millis) => Instant.ofEpochMilli(millis).atZone(ZoneOffset.UTC).toLocalDate |
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.joda.time.{DateTime, DateTimeZone, LocalDate, LocalDateTime} | |
import play.api.libs.json._ | |
import reactivemongo.play.json._ | |
object JodaBsonImplicitConverters { | |
// ### Automatic conversion of { DateTime, LocalDate } <-> BSONDateTime <-> ISODate ### | |
implicit val dateTimeRead: Reads[DateTime] = | |
(__ \ "$date").read[Long].map(new DateTime(_)) |
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
// | |
// To use the below, simply import Gzip._ instead of import com.spingo.op_rabbit.PlayJsonSupport._ | |
// | |
import java.io.{ByteArrayInputStream, ByteArrayOutputStream} | |
import java.util.zip.{GZIPInputStream, GZIPOutputStream} | |
import com.spingo.op_rabbit._ | |
import play.api.libs.json._ | |
import scala.io.{Codec, Source} |