Skip to content

Instantly share code, notes, and snippets.

// Without printing comptime argument or anytype.
const std = @import("std");
const assert = std.debug.assert;
pub const Logger = ScopedLogger(null);
pub fn ScopedLogger(comptime maybe_scope: ?type) type {
return struct {
ptr: *anyopaque,
writeFn: *const fn (ptr: *anyopaque, buf: []const u8) void,
import time
import subprocess
import datetime
import sys
import re
import csv
def format_timestamp(timestamp):
return timestamp.strftime("%d_%m_%Y_%H_%M_%S")
@dadepo
dadepo / keybase
Created September 11, 2019 02:39
### Keybase proof
I hereby claim:
* I am dadepo on github.
* I am dadepo (https://keybase.io/dadepo) on keybase.
* I have a public key ASA1f_Nq0xFd20x2zwFYSey-OkIDcbDGbq7EFkjn9xwRago
To claim this, I am signing this object:
// Axon dependencies in pom.xml
<dependency>
<groupId>org.axonframework</groupId>
<artifactId>axon-eventsourcing</artifactId>
<version>${axon.version}</version>
</dependency>
<dependency>
<groupId>org.axonframework</groupId>
<artifactId>axon-modelling</artifactId>
import org.apache.flink.api.common.typeinfo.TypeInformation
import org.apache.flink.streaming.api.scala.{DataStream, KeyedStream}
import org.apache.flink.streaming.api.scala._
import shapeless._
import record._
import shapeless.LabelledGeneric
import shapeless.labelled.FieldType
import shapeless.Witness
import shapeless.ops.record.Selector
import shapeless.syntax.RecordOps
@dadepo
dadepo / Reader_monads_and_friends.scala
Last active June 10, 2018 15:33
Implementation of a program that requires configuration using Reader Monad (via Cats), Implicit Parameters, and Implicit Function.
/**
* Chapter 4 of the Scala with Cats book (https://underscore.io/books/scala-with-cats/) has got
* an exercise regarding the Reader monad which is supposed to showcase the classic use case of Reader Monad:
* which is to build programs that accepts a configuration as parameter.
*
* The exercise can be summarised as follows.
*
* Given a DB configuration with the following shape:
* case class Db(usernames: Map[Int, String], passwords: Map[String, String])
* where usernames is Map of userid to username
@dadepo
dadepo / macosx_remove_java9.sh
Created September 24, 2017 07:18 — forked from schnell18/macosx_remove_java9.sh
MacOS X remove Java 9
sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.jdk/
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane