Skip to content

Instantly share code, notes, and snippets.

View t3hnar's full-sized avatar
🎯
Focusing

Yaroslav Klymko t3hnar

🎯
Focusing
View GitHub Profile
@t3hnar
t3hnar / revert-to.sh
Last active October 31, 2019 15:36
revert-to.sh
REVISION=$1 &&
BRANCH=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') &&
git reset --hard $REVISION &&
MSG="revert $BRANCH to ${REVISION}" &&
git merge -s ours @{1} -m "${MSG}" &&
echo $MSG

Cats Effect 3.0 Proposal

If you're someone for whom code speaks louder than words, here's a branch to ponder: https://github.com/typelevel/cats-effect/tree/ce3

The following is a proposal for Cats Effect 3, collaboratively devised over the last few months by several of the maintainers and contributors to the library. I will frequently use first-person in this document (because I'm lazy), which is posted under my name (ditto), but it really was a joint effort. As with any joint effort, there has definitely been some healthy debate about several of the concepts in this proposal. For reference, these are the things we're the least sure about:

  • Concurrent now takes two type parameters, and thus is somewhat less ergonomic
  • Region has been added, along with some complex associated machinery
    • One component of that machinery is the Safe.Case type
  • Several existing laws are retained (such as Sync being stack-safe)
@relaxdiego
relaxdiego / graphite.md
Last active January 5, 2022 09:07 — forked from surjikal/graphite.md
Installing Graphite in OS X Mavericks

Follow these steps to install graphite on OS X Mavericks.

Prerequisites

  • Homebrew
  • Python 2.7
  • Git

Install dependencies

Install Cairo and friends

@patriknw
patriknw / LoggingMailbox.scala
Last active January 5, 2023 08:12
Logs the mailbox size when exceeding the configured limit. Implemented in Scala and Java. Copy one of them to your project and define the configuration. This code is licensed under the Apache 2 license.
/**
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.contrib.mailbox
import scala.concurrent.duration._
import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.atomic.AtomicLong
import com.typesafe.config.Config
import akka.actor.{ ActorContext, ActorRef, ActorSystem, ExtendedActorSystem }
@paulp
paulp / test.scala
Created February 1, 2013 17:57
statically typed companion objects
package s
object Test {
// Observe that x.companion is statically typed such that foo is callable
def f1() = {
val x = new Foo
println(x) // Foo instance
println(x.companion) // Foo companion
println(x.companion.foo) // I'm foo!
@kouphax
kouphax / Darcula.itermcolors
Created January 24, 2013 22:27
Jetbrains IntelliJ IDEA Darcula Theme ported to iTerm2 colour scheme. WIP.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.16300885379314423</real>
<key>Green Component</key>
<real>0.16304571926593781</real>
@t3hnar
t3hnar / blog.scala
Created September 4, 2012 18:52
Very simple example of event sourcing
object blog {
object events {
sealed trait PostEvent
case class PostCreated(title: String) extends PostEvent
case class PostRenamed(id: Long, name: String) extends PostEvent
class EventStream() {