Skip to content

Instantly share code, notes, and snippets.

View kevinherron's full-sized avatar

Kevin Herron kevinherron

View GitHub Profile
@cretz
cretz / kotlin-annoyances.md
Last active November 12, 2019 22:54
Kotlin Annoyances

Kotlin Annoyances

These are things that I found annoying writing a complex library in Kotlin. While I am also a Scala developer, these should not necessarily be juxtaposed w/ Scala (even if I reference Scala) as some of my annoyances are with features that Scala doesn't even have. This is also not trying to be opinionated on whether Kotlin is good/bad (for the record, I think it's good). I have numbered them for easy reference. I can give examples for anything I am talking about below upon request. I'm sure there are good reasons for all of them.

  1. Arrays in data classes break equals/hashCode and ask you to overload it. If you are going to need to overload it and arrays have no overridability, why not make the least-often use case (the identity-comparison equals) the exception?
@kevinherron
kevinherron / LoggerExtensions.kt
Last active May 22, 2017 13:12
Kotlin extensions to SLF4J Logger with MDC support
import org.slf4j.Logger
import org.slf4j.MDC
import org.slf4j.Marker
import org.slf4j.helpers.MessageFormatter
typealias LazyPair = () -> Pair<String, String>
// <editor-fold desc="Logger.trace Extensions">
inline fun Logger.trace(msg: () -> Any?) {
this.trace(msg.invoke().toString())
@0XDE57
0XDE57 / config.md
Last active May 15, 2024 02:54
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable. I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@djspiewak
djspiewak / streams-tutorial.md
Created March 22, 2015 19:55
Introduction to scalaz-stream

Introduction to scalaz-stream

Every application ever written can be viewed as some sort of transformation on data. Data can come from different sources, such as a network or a file or user input or the Large Hadron Collider. It can come from many sources all at once to be merged and aggregated in interesting ways, and it can be produced into many different output sinks, such as a network or files or graphical user interfaces. You might produce your output all at once, as a big data dump at the end of the world (right before your program shuts down), or you might produce it more incrementally. Every application fits into this model.

The scalaz-stream project is an attempt to make it easy to construct, test and scale programs that fit within this model (which is to say, everything). It does this by providing an abstraction around a "stream" of data, which is really just this notion of some number of data being sequentially pulled out of some unspecified data source. On top of this abstraction, sca

@jromero
jromero / custom_rules.xml
Created May 2, 2014 18:16
Ant build script xml for doing annotation preprocessing from Dagger. Port of https://github.com/excilys/androidannotations/wiki/Automating-the-Build-in-Jenkins-with-Ant
<?xml version="1.0" encoding="UTF-8"?>
<project name="******YOUR PROJECT NAME******" default="help">
<property name="apt_generated.dir" value="${basedir}/.apt_generated/" />
<target name="-pre-clean">
<delete dir="${apt_generated.dir}" verbose="${verbose}" />
<mkdir dir="${apt_generated.dir}" />
</target>
<target name="-pre-compile">