Skip to content

Instantly share code, notes, and snippets.

@foo9
foo9 / mecab_hiragana.md
Created July 27, 2015 06:50
mecabひらがな変換
$ echo "2015/07/27: 明日は晴れだ" | mecab -Oyomi | nkf -w --hiragana
2015/07/27: あしたははれだ
@mathyourlife
mathyourlife / kafka.md
Created September 17, 2014 13:45
kafka notes

Apache Kafka

"A high-throughput distributed messaging system." site

Notes taken from source

Overview

  • Created at LinkedIn (open sourced in 2011)
@DanSnow
DanSnow / circle.yml
Created December 22, 2016 05:32
Use Crystal on CircleCI
machine:
environment:
CRYSTAL_VERSION: "0.20.1" # Replace version to which you're using
PATH: "${PATH}:${HOME}/.crystal/bin"
CRYSTAL_URL: "https://github.com/crystal-lang/crystal/releases/download/${CRYSTAL_VERSION}/crystal-${CRYSTAL_VERSION}-1-linux-x86_64.tar.gz"
dependencies:
cache_directories:
- ~/.crystal
- lib
- .shards
@drexin
drexin / Macros.scala
Last active October 27, 2016 09:41
macros to get current file and line, inspired by ruby's __FILE__ and __LINE__
import java.io.File
import language.experimental.macros
import scala.reflect.macros.Context
object Macros {
def LINE: Int = macro lineImpl
def lineImpl(c: Context): c.Expr[Int] = {
import c.universe._
@PanzerKunst
PanzerKunst / EmailMessage.scala
Last active October 1, 2016 17:01
Small modification of Raúl Raja's Scala code to sent emails
import scala.concurrent.duration.FiniteDuration
/**
* The email message sent to Actors in charge of delivering email
*
* @param subject the email subject
* @param recipient the recipient
* @param from the sender
* @param text alternative simple text
* @param html html body
@kazuho
kazuho / gist:5027236
Last active February 20, 2016 18:47
MessagePackの文字列型追加において、Extended型を導入する提案

#MessagePackの文字列型追加において、Extended型を導入する提案

本提案は https://gist.github.com/frsyuki/5022569 https://gist.github.com/frsyuki/5022460 において提案された「バイナリ型」の構造に変更を施すものである。

##解決しようとする問題

  • MessagePackへの拡張は今後行われないとしても、独自に拡張する提案が今後頻発しそう
  • 拡張フォーマットは、既存のMessagePackに対して後方互換にならない(なりようがない)ため、相互運用性を損なう可能性が高い。これが問題

##提案する手法

@owainlewis
owainlewis / Functors.scala
Created December 16, 2013 14:10
Functors
// covariant functor
trait Functor[F[_]] {
def fmap[A, B](f: A => B): F[A] => F[B]
}
// contravariant functor
trait Contravariant[F[_]] {
def contramap[A, B](f: B => A): F[A] => F[B]
}