Skip to content

Instantly share code, notes, and snippets.

View deadblackclover's full-sized avatar
:octocat:
Happy Hacking!

DEADBLACKCLOVER deadblackclover

:octocat:
Happy Hacking!
View GitHub Profile
trait IdNewtype {
trait Tag extends Any
type Type <: Tag
def apply(value: UUID): Type = value.asInstanceOf[Type]
implicit def ops(id: Type): IdNewtype.Ops[Type] = new service.IdNewtype.Ops[Type](id)
def random() = apply(UUID.randomUUID())
def parse(s: String): Option[Type] = Try(UUID.fromString(s)).toOption.map(apply)
@GomZik
GomZik / ZeroFrame.js
Last active October 7, 2019 17:48
ZeroFrame api ES6
const CMD_INNER_READY = 'innerReady'
const CMD_RESPONSE = 'response'
const CMD_WRAPPER_READY = 'wrapperReady'
const CMD_PING = 'ping'
const CMD_PONG = 'pong'
const CMD_WRAPPER_OPENED_WEBSOCKET = 'wrapperOpenedWebsocket'
const CMD_WRAPPER_CLOSE_WEBSOCKET = 'wrapperClosedWebsocket'
class ZeroFrame {
constructor(url) {