Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

Wojciech Langiewicz wlk

🌴
On vacation
Block or report user

Report or block wlk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am wlk on github.
  • I am wlk (https://keybase.io/wlk) on keybase.
  • I have a public key ASDvVEmt7yas5hZeYOqwhDZQdiXGJ-PXugVAU4Xxwpv3jAo

To claim this, I am signing this object:

View akkaissue.scala
import akka.actor.SupervisorStrategy.Restart
import akka.actor.{Actor, ActorInitializationException, ActorSystem, OneForOneStrategy, Props}
object Main extends App {
var attempt: Int = 0
class FailingActor extends Actor {
if (attempt == 0) {
// throw exception only for the first time, simulating first attempt to create an actor that fails
View a.json
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid-schema",
"description": "Validation for UUID",
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
View author.scala
case class Author(id: UUID, name: String, dateOfBirth: DateTime, dateOfDeath: Option[DateTime], createdAt: DateTime, updatedAt: DateTime)
def toJsonapi(author: Author) = {
ResourceObject(
`type` = author.`type`,
id = Some(author.id),
attributes = authorAttributes(author),
relationships = authorRelationships(author),
links = List(Links.Self(selfLink(author))
)
View author-with-books-snippet.json
{
"data": {
"id": "1",
"type": "authors",
"attributes": {
"name": "J. R. R. Tolkien",
"date_of_birth": "1892-01-03",
"date_of_death": "1973-09-02",
"created_at": "2017-06-18 11:30:16",
"updated_at": "2017-06-18 11:30:16"
View author-with-books.json
{
"data": {
"id": "1",
"type": "authors",
"attributes": {
"name": "J. R. R. Tolkien",
"date_of_birth": "1892-01-03",
"date_of_death": "1973-09-02",
"created_at": "2017-06-18 11:30:16",
"updated_at": "2017-06-18 11:30:16"
View chapter.json
{
"data": {
"id": "1",
"type": "chapters",
"attributes": {
"title": "A Long-expected Party",
"ordering": 1,
"created_at": "2017-06-18 11:30:17",
"updated_at": "2017-06-18 11:30:17"
},
View book.json
{
"data": {
"id": "1",
"type": "books",
"attributes": {
"date_published": "1954-07-29",
"title": "The Fellowship of the Ring",
"created_at": "2017-06-18 11:30:16",
"updated_at": "2017-06-18 11:30:16"
},
View author.json
{
"data": {
"id": "1",
"type": "authors",
"attributes": {
"name": "J. R. R. Tolkien",
"date_of_birth": "1892-01-03",
"date_of_death": "1973-09-02",
"created_at": "2017-06-18 11:30:16",
"updated_at": "2017-06-18 11:30:16"
View gist:824f9d8f351572c38e2f2b144223f3ad
### Keybase proof
I hereby claim:
* I am wlk on github.
* I am wlk (https://keybase.io/wlk) on keybase.
* I have a public key whose fingerprint is 1D98 51AF 74D4 422E 513D 0F3D 06BD 87E0 6DB7 0E4B
To claim this, I am signing this object:
You can’t perform that action at this time.