Skip to content

Instantly share code, notes, and snippets.

View plokhotnyuk's full-sized avatar

Andriy Plokhotnyuk plokhotnyuk

View GitHub Profile
@bbjubjub2494
bbjubjub2494 / Main$.jad
Created January 13, 2019 20:23
illustrating scala auto{,un}boxing
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3)
// Source File Name: Main.scala
import java.util.function.Function;
import scala.Predef$;
import scala.runtime.BoxesRunTime;
public final class Main$
@abeln
abeln / scala-explicit-nulls.md
Last active December 18, 2020 13:57
Scala with Explicit Nulls
@jammerwock
jammerwock / gist:11b0dc95a3538decdf8bdb58e95e1c3b
Last active November 14, 2022 15:44
Play Json AnyVal inmap example
import play.api.libs.functional.syntax._
import play.api.libs.json.{Format, Reads, Writes, _}
case class Person(name: String) extends AnyVal
object Person {
implicit val f1: Format[Person] = implicitly[Format[String]].inmap[Person](Person(_), _.name)
implicit val f2: Format[Person] = Format(__.read[String].map(Person(_)), implicitly[Writes[String]].contramap { case Person(v) => v })
@scalway
scalway / UPickleMagnoliaDerive.scala
Last active June 28, 2018 10:32
UPickle Magnolia Derive
package rabbi
import magnolia._
import ujson.{ObjVisitor, Visitor}
import upickle.{Api, AttributeTagged}
import scala.language.experimental.macros
import scala.reflect.ClassTag
trait UpickleSupportCommon {
| Msg |BooPickle| Chill | CBOR | Smile | Thrift | JSON |ProtoBuf | Kryo |Pickling | Scrooge |Java Ser.|
|-----------|---------|---------|---------|---------|---------|---------|---------|---------|---------|---------|---------|
| Site 1k | 555 | 908 | 877 | 843 | 561 | 1017 | 554 | 573 | 1681 | 561 | 2207 |
| Site 2k | 1165 | 1695 | 1737 | 1563 | 1175 | 2046 | 1175 | 1177 | 2989 | 1175 | 3311 |
| Site 4k | 1917 | 2507 | 3246 | 2604 | 1937 | 3981 | 1930 | 1950 | 6000 | 1937 | 4549 |
| Site 8k | 3047 | 3644 | 6120 | 4342 | 3071 | 7743 | 3058 | 3096 | 13034 | 3069 | 6615 |
| Site 64k | 25769 | 26260 | 49689 | 34259 | 26803 | 64493 | 27111 | 24978 | 106901 | 26823 | 43168 |
| Events 1k | 593 | 588 | 1063 | 1127 | 592 | 1277 | 578 | 631 | 1565 | 592 | 2716 |
| Events 2k | 1220 | 1260
This file has been truncated, but you can view the full file.
[
{
"jmhVersion" : "1.21",
"benchmark" : "bench.Case1.decodeArgonaut",
"mode" : "thrpt",
"threads" : 1,
"forks" : 2,
"jvm" : "/usr/lib/jvm/java-8-oracle/jre/bin/java",
"jvmArgs" : [
"-server",
This file has been truncated, but you can view the full file.
[info] Loading settings from idea.sbt ...
[info] Loading global plugins from /home/andriy/.sbt/1.0/plugins
[info] Loading settings from plugins.sbt ...
[info] Loading project definition from /home/andriy/Projects/com/github/plokhotnyuk/json-bench-1/project
[info] Loading settings from build.sbt ...
[info] Set current project to json-bench (in build file:/home/andriy/Projects/com/github/plokhotnyuk/json-bench-1/)
[info] Updating ...
[info] Done updating.
[info] Formatting 1 Scala source in json-bench-1:sbt ...
[success] Total time: 2 s, completed May 22, 2018 3:58:50 AM
@nadavrot
nadavrot / Matrix.md
Last active July 12, 2025 20:34
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@jvican
jvican / sbt-build-stats-git.sh
Created May 3, 2018 21:23
Script to find out the percentage of commits that modified sbt build files in a repository.
#!/bin/bash -
#===============================================================================
#
# FILE: sbt-build-stats-git.sh
#
# USAGE: ./sbt-build-stats-git.sh
#
# DESCRIPTION: Script that outputs what's the percentage of commits in a codebase
# that modified the sbt build files. It can be modified to support
# statistics in other files.
@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active July 2, 2025 20:56
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com