Skip to content

Instantly share code, notes, and snippets.

Avatar

Denis Dvornikov dennypenta

  • Russian Federation
View GitHub Profile
View build.sbt
name := "meme_keker"
version := "0.1"
scalaVersion := "2.13.1"
libraryDependencies += "com.typesafe.akka" % "akka-actor_2.13" % "2.5.23"
libraryDependencies += "com.typesafe.akka" % "akka-http_2.13" % "10.1.8"
libraryDependencies += "com.typesafe.akka" %% "akka-stream" % "2.6.3"
View app.scala
package com.dennypenta.meme_keker
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.http.scaladsl.Http
import akka.http.scaladsl.model.HttpRequest
import akka.http.scaladsl.model.HttpResponse
import scala.concurrent.Future
import scala.util.{Failure, Success}
@dennypenta
dennypenta / marshal_custom_key.go
Created Feb 28, 2020
Example provides use case marshalling map with custom key as a structure to json
View marshal_custom_key.go
package main
import (
"encoding"
"encoding/json"
"fmt"
)
type key struct {
this string
View short_mapping.go
type Model struct {
value []byte
}
func (m *Model) UnmarshalJSON(v []byte) error {
m.value = v
return nil
}
View testing peewee_async manager
from aiohttp.test_utils import unittest_run_loop
from main import Model, new_manager
import asyncio
import unittest
class ManagerTestCase(unittest.TestCase):
def setUp(self):