Skip to content

Instantly share code, notes, and snippets.

View iomonad's full-sized avatar
🍋
λ

iomonad iomonad

🍋
λ
  • 14:58 (UTC +03:00)
View GitHub Profile
@iomonad
iomonad / ingestrule.proto
Created November 19, 2018 14:02
Protobuff contract
syntax = "proto3";
option java_multiple_files = true;
option java_package = "fr.canal.rocket.configuration.grpc";
option java_outer_classname = "IngestRulesProto";
package ingestrule;
enum TransportType {
ASPERA = 0;
@Icelandjack
Icelandjack / Yoneda.markdown
Last active February 10, 2023 00:06
Yoneda
import Data.Functor.Yoneda
import Data.Char
import Data.Kind

infixr 5
  ·

type  List :: (Type -> Type) -> Constraint
class List f where
@iomonad
iomonad / SimplePartitionSample.scala
Created November 5, 2018 13:50 — forked from johanandren/SimplePartitionSample.scala
Sample of using partition to split up incoming elements over multiple outgoing streams
import akka.actor.ActorSystem
import akka.stream._
import akka.stream.scaladsl._
import scala.io.StdIn
import scala.util.Random
object SimplePartitionSample extends App {
implicit val system = ActorSystem()
@robey
robey / apple1-rom.txt
Last active May 22, 2023 03:49
apple 1 ROM disassembly
;
; the "monitor ROM" of an apple 1 fit in one page (256 bytes).
;
; this is my attempt to take the disassembled code, give names to the
; variables and routines, and try to document how it worked.
;
;
; an apple 1 had 8KB of RAM (more, if you hacked on the motherboard), and a
; peripheral chip that drove the keyboard and video. the video was run by a
; side processor that could treat the display as an append-only terminal that
@davideicardi
davideicardi / PassThroughFlow.scala
Last active June 6, 2022 08:32
Akka stream generic pass through flow. For latest implementation see https://developer.lightbend.com/docs/alpakka/current/patterns.html#passthrough
/*
https://scalafiddle.io/sf/sniohcZ/3
(old version: https://scalafiddle.io/sf/sniohcZ/1)
Use PassThroughFlow when you have a message that should be used in a
flow that trasform it but you want to maintain the original message for
another following flow.
For example if you consume messages from Kafka (CommittableMessage).
You process the message (transform, save it inside a database, ...) and then you need again the original message
to commit the offset.
@gvolpe
gvolpe / di-in-fp.md
Last active September 16, 2024 07:18
Dependency Injection in Functional Programming

Dependency Injection in Functional Programming

There exist several DI frameworks / libraries in the Scala ecosystem. But the more functional code you write the more you'll realize there's no need to use any of them.

A few of the most claimed benefits are the following:

  • Dependency Injection.
  • Life cycle management.
  • Dependency graph rewriting.
@iomonad
iomonad / dwarf.asm
Last active June 1, 2018 14:50
Our Corewar/RedCode team warrior with 99% success potential.
; D O O M
;%%%%% %%%%% %%%% %%%%%% %% %% _---_ %%% %%% %%%% %%%%%% %%%% %% %%
;%% %% %% %% %% %% %% %% ." ". %%%%%%%% %% %% %% %% %% %%
;%% ## #### ###### ## ###%%% | () () | %% %# ## ###### ## ## ###%%%
;## ,## ## ## ## ## ## `## \ A / ## #= ## ## ## ## ## ## `##
;####= =###= =# #= =# =# ## |"+++"| ## =- #= =# #= =# ###= =# ##
;##= =# "---" #= =#
; WAD RANKING
.name "dwarf"
#include <stdio.h>
int
main(int argc, char *argv[])
{
int i = 0;
i ^= i&~-~i|~i&-~i;
printf("%d\n", i);
return (0);
@oleg-py
oleg-py / autolenses.scala
Created April 15, 2018 13:02
Automatic generation of lenses and MonadState instances based on 'em
import cats.Monad
import cats.data.StateT
import cats.effect._
import cats.implicits._
import cats.mtl._
import cats.mtl.implicits._
import shapeless._
import scala.language.higherKinds
case class Health(num: Int)
@seanjensengrey
seanjensengrey / octal_x86.txt
Last active January 13, 2025 22:43
x86 is an octal machine
# source:http://geocities.com/SiliconValley/heights/7052/opcode.txt
From: [email protected] (Mark Hopkins)
Newsgroups: alt.lang.asm
Subject: A Summary of the 80486 Opcodes and Instructions
(1) The 80x86 is an Octal Machine
This is a follow-up and revision of an article posted in alt.lang.asm on
7-5-92 concerning the 80x86 instruction encoding.
The only proper way to understand 80x86 coding is to realize that ALL 80x86