Skip to content

Instantly share code, notes, and snippets.

View zsolt-donca's full-sized avatar
🥸

Zsolt Donca zsolt-donca

🥸
View GitHub Profile
@zsolt-donca
zsolt-donca / google-chrome-unstable_with_wayland_debug.log
Created January 20, 2021 17:52
google-chrome-unstable_with_wayland_debug.log on ozone/wayland with WAYLAND_DEBUG=1
[2373186.386] -> [email protected]_registry(new id wl_registry@2)
[2373186.403] -> [email protected](new id wl_callback@3)
[2373186.476] [email protected]_id(3)
[2373186.481] [email protected](1, "wl_shm", 1)
[2373186.488] -> [email protected](1, "wl_shm", 1, new id [unknown]@4)
[2373186.495] [email protected](2, "zwp_linux_dmabuf_v1", 3)
[2373186.500] -> [email protected](2, "zwp_linux_dmabuf_v1", 3, new id [unknown]@5)
[2373186.504] -> [email protected](new id wl_callback@6)
[2373186.506] [email protected](3, "wl_compositor", 4)
[2373186.509] -> [email protected](3, "wl_compositor", 4, new id [unknown]@7)
@zsolt-donca
zsolt-donca / gist:2be9643110ec5496276adbdc144473bb
Created January 20, 2021 17:29
google-chrome-unstable.log on ozone/wayland
[19315:19315:0120/180446.390531:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
[19276:19276:0120/180446.400579:ERROR:wayland_surface.cc(59)] Server doesn't support zwp_linux_explicit_synchronization_v1.
[19276:19276:0120/180446.566103:ERROR:wayland_surface.cc(59)] Server doesn't support zwp_linux_explicit_synchronization_v1.
[19315:19315:0120/180446.746157:ERROR:gl_surface_egl.cc(774)] EGL Driver message (Error) eglCreateImageKHR: _eglParseImageAttribList
[19315:19315:0120/180446.746279:ERROR:gl_image_egl.cc(37)] Error creating EGLImage: EGL_BAD_PARAMETER
[19315:19315:0120/180446.746442:ERROR:gpu_memory_buffer_factory_native_pixmap.cc(257)] Failed to create GLImage 3810x2880, RGBA_8888, usage SCANOUT
[19315:19315:0120/180446.754903:ERROR:gl_surface_egl.cc(774)] EGL Driver message (Error) eglCreateImageKHR: _eglParseImageAttribList
[19315:19315:0120/180446.755026:ERROR:gl_image_egl.cc(37)] Error creating EGLImage: EGL_BAD_PARAMETER
[19315:19315:0120/180446
@zsolt-donca
zsolt-donca / gist:62f7348ad71de1b566198109612eedef
Created December 9, 2020 19:25
sway.log while crashing with the clipboard issue
00:00:00.000 [sway/main.c:327] Sway version 1.5-a1591c23 (Dec 9 2020, branch 'master')
00:00:00.002 [sway/main.c:154] Linux ROC01-HYMT373 5.9.13-zen1-1-zen #1 ZEN SMP PREEMPT Tue, 08 Dec 2020 12:10:52 +0000 x86_64 GNU/Linux
00:00:00.002 [sway/main.c:170] Contents of /etc/os-release:
00:00:00.002 [sway/main.c:154] NAME="Arch Linux"
00:00:00.002 [sway/main.c:154] PRETTY_NAME="Arch Linux"
00:00:00.002 [sway/main.c:154] ID=arch
00:00:00.002 [sway/main.c:154] BUILD_ID=rolling
00:00:00.002 [sway/main.c:154] ANSI_COLOR="38;2;23;147;209"
00:00:00.002 [sway/main.c:154] HOME_URL="https://www.archlinux.org/"
00:00:00.002 [sway/main.c:154] DOCUMENTATION_URL="https://wiki.archlinux.org/"
@zsolt-donca
zsolt-donca / EnumCodec.scala
Created August 25, 2019 14:45
EnumCodec.scala - working
package testing
import shapeless.labelled.FieldType
import shapeless.{:+:, CNil, Coproduct, HNil, Inl, Inr, LabelledGeneric, Lazy, Witness, labelled}
trait EnumCodec[T] {
def encode: T => String
def decode: String => Option[T]
}
package testing
import org.scalatest.FunSuite
import shapeless.labelled.FieldType
import shapeless.{:+:, CNil, Coproduct, Generic, HNil, Inl, Inr, LabelledGeneric, Lazy, Witness}
trait EnumCodec[T] {
def encode: T => String
def decode: String => Option[T]
}
@zsolt-donca
zsolt-donca / example-with-traverse-and-writer.scala
Last active May 23, 2018 20:19
Part 2: Followup of the FP meetup "Abstractions of higher kind" - using Writer
import cats._
import cats.data._
import cats.implicits._
case class User(age: Int)
// notice F: FlatMap; fetchUser returning G[F[User]], and the use of flatTraverse
def complicatedFunction[F[_]: Traverse : FlatMap, G[_]: Applicative, A: Monoid](ids: F[Int], fetchUser: Int => G[F[User]], consume: User => A): G[A] = {
ids.flatTraverse(fetchUser)
@zsolt-donca
zsolt-donca / example-with-traverse-and-validated-nel.scala
Last active May 23, 2018 20:18
Part 1: Followup of the FP meetup "Abstractions of higher kind" - using ValidatedNel
import cats._
import cats.data._
import cats.implicits._
case class User(age: Int)
def complicatedFunction[F[_]: Traverse, G[_]: Applicative, A: Monoid](ids: F[Int], fetchUser: Int => G[User], consume: User => A): G[A] = {
ids.traverse(fetchUser)
.map(_.foldMap(consume))
@zsolt-donca
zsolt-donca / Main2.scala
Created June 7, 2017 19:44
Playing around with Cats' State monad
package testing
import cats._
import cats.data._
import cats.implicits._
object Main2 extends App {
case class Stats(warning: Int, error: Int)
val keypad: Seq[Seq[Int]] = Seq(Seq(1, 2, 3), Seq(4, 5, 6), Seq(7, 8, 9))
case class Pos(row: Int, col: Int)
sealed trait Dir
case object Up extends Dir
case object Left extends Dir
case object Right extends Dir
case object Down extends Dir
@zsolt-donca
zsolt-donca / StringDecode.sc
Created February 23, 2017 10:49
Scala solution (as a worksheet) to the string decoding problem: https://leetcode.com/problems/decode-string
def splitWhile[A](it: Seq[A])(pred: A => Boolean): (Seq[A], Seq[A]) = {
(it.takeWhile(pred), it.dropWhile(pred))
}
def splitParenContentsAndRest(s: Seq[Char]): (Seq[Char], Seq[Char]) = {
assert(s.head == '[')
val parenCounts = s.scanLeft(0) {
case (parenCount, '[') => parenCount + 1