Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
WFH / WTF

Mateusz Kubuszok MateuszKubuszok

🏠
WFH / WTF
View GitHub Profile
View TypedSliding.scala
trait TypedSlide[F[_], I <: Int] {
type Out[A]
def sliding[A](fa: F[A]): F[Out[A]]
}
object TypedSlide {
type Arbitrary
class Helper[F[_], I <: Int] {
def apply[OOut[_]](f: F[Arbitrary] => F[OOut[Arbitrary]]) = new TypedSlide[F, I] {
type Out[A] = OOut[A]
@MateuszKubuszok
MateuszKubuszok / algebras.scala
Last active Mar 2, 2021
Algebras implementation which isn't based on nested type hierarchy
View algebras.scala
import scala.language.reflectiveCalls
type Nullary[A] = Unit
type Unary[A] = A
type Binary[A] = (A, A)
trait Algebra {
type Set
type Operation[F[_]] = F[Set] => Set
@MateuszKubuszok
MateuszKubuszok / speeches.md
Last active Mar 17, 2021
My public speeches, presentations and and stuff
View speeches.md

My public speeches

Actually, more like hall of shame because I cannot watch/listen to myself without cringe, but in this time and age everyone has to be a salesman. Well, not really, but it kind of help with self-development and getting confidence, so whatever. Remember kids! You don't have to be competent to be a public speaker! (Or write a book. Or blog. Or OSS. Or get a job.)

Optimizing Heavy Web Service presentation

View FList.scala
sealed trait FList[F[_]] extends Product with Serializable
object FList {
final case class Last[F[_], A, B](f: A => F[B]) extends FList[F]
final case class Cons[F[_], A, B, Tail <: FList[F]](f: A => F[B], tail: Tail) extends FList[F]
}
implicit class FunOps[F[_], A, B](f: A => F[B]) extends AnyVal {
def toFList: FList.One[F, A, B] = FList.One(f)
View keybase.md

Keybase proof

I hereby claim:

  • I am mateuszkubuszok on github.
  • I am mateuszkubuszok (https://keybase.io/mateuszkubuszok) on keybase.
  • I have a public key ASDad2uAPXJRFF-i7B7nKeQixgIFu5bVsXJLqD7jJGRg0Ao

To claim this, I am signing this object:

@MateuszKubuszok
MateuszKubuszok / flame-graph-cpu-reverse.svg
Created Aug 31, 2020
Flame graphs for FizzBuzzBenchmark - Things that you need to know about JVM (that matter in Scala)
View flame-graph-cpu-reverse.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MateuszKubuszok
MateuszKubuszok / .dotsync.yml
Last active Aug 13, 2020
Utility for copying dotfiles from HOME to some backup directory e.g. git/Dropbox/etc
View .dotsync.yml
backup: .dotsync_bck
global:
include:
- .bashrc
- .zshrc
exclude: []
local:
laptop2:
include:
- .snxrc
View Test2$.java
Compiled from "Test2.scala"
public final class Test2$ {
public static final Test2$ MODULE$;
public static {};
Code:
0: new #2 // class Test2$
3: dup
4: invokespecial #20 // Method "<init>":()V
7: putstatic #22 // Field MODULE$:LTest2$;
View Test1$.java
Compiled from "Test1.scala"
public final class Test1$ {
public static final Test1$ MODULE$;
public static {};
Code:
0: new #2 // class Test1$
3: dup
4: invokespecial #18 // Method "<init>":()V
7: putstatic #20 // Field MODULE$:LTest1$;
@MateuszKubuszok
MateuszKubuszok / .tmux.conf
Created May 18, 2020
Poor man's iTerm2-like Tmux + Alacritty
View .tmux.conf
# Open window/pane in the same PATH
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# Reload config
bind R source-file ~/.tmux.conf \; display-message "Config reloaded..."
# Window tab menu
bind-key -T root MouseDown3Status display-menu -T "#[align=centre]#{window_index}:#{window_name}" -t = -x W -y S \
"Swap Left" l "swap-window -t:-1" \