Skip to content

Instantly share code, notes, and snippets.

View okapies's full-sized avatar
💭
⌨️

Yuta Okamoto okapies

💭
⌨️
View GitHub Profile
@xdamman
xdamman / install_ffmpeg_ubuntu.sh
Created July 2, 2014 21:03
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update

Adapted from “Lidia’s Commonsense Italian Cooking,” by Lidia Bastianich (Knopf, 2013)

By Julia Moskn

Homemade marinara is almost as fast and tastes immeasurably better than even the best supermarket sauce -- and it's made with basic pantry ingredients. All the tricks to a bright red, lively-tasting sauce, made just as it is in the south of Italy (no butter, no onions) are in this recipe. Use a skillet instead of the usual saucepan: the water evaporates quickly, so the tomatoes are just cooked through as the sauce becomes thick.

Total time: 25 minutes

Ingredients

@jboner
jboner / akka-cluster-implementation-notes.md
Last active March 4, 2023 22:30
Akka Cluster Implementation Notes

Akka Cluster Implementation Notes

Slightly disorganized but reasonably complete notes on the algorithms, strategies and optimizations of the Akka Cluster implementation. Could use a lot more links and context etc., but was just written for my own understanding. Might be expanded later.

Links to papers and talks that have inspired the implementation can be found on the 10 last pages of this presentation.

Akka Gossip

Gossip state

This is the Gossip state representation:

@xuwei-k
xuwei-k / -Xprint:jvm
Last active December 26, 2015 16:48 — forked from okapies/gist:7182102
[[syntax trees at end of jvm]] // Param.scala
package <empty> {
final class Param extends Object {
<paramaccessor> private[this] val i: Int = _;
<stable> <accessor> <paramaccessor> def i(): Int = Param.this.i;
override <synthetic> def hashCode(): Int = Param.hashCode$extension(Param.this.i());
override <synthetic> def equals(x$1: Object): Boolean = Param.equals$extension(Param.this.i(), x$1);
def <init>(i: Int): Param = {
Param.this.i = i;
Param.super.<init>();
@eed3si9n
eed3si9n / BlackLagoonNotes.txt
Created July 16, 2013 02:05
Black Lagoon 翻訳のノート 翻訳: "Cake Pattern: The Bakery from the Black Lagoon" http://okapies.hateblo.jp/entry/2013/07/15/232456
現行訳: save関数はUserModuleにもMessageModuleにもあるので衝突してしまう。ここでは引数の型が違うのでコンパイラエラーになるけど、オーバーロードの場合は C++ の悪夢の日々よ再び。
訳案: save関数はUserModuleにもMessageModuleにもある。受け取る型が違うので、コンパイラはこれを区別することができるけど、それはオーバーロードだ。オーバーロードはキモいし、酷いし、C++ 時代の遺物なので、できれば回避したい。
現行訳: 巨大なシステムでモックを使いたいときは、Spring 等の依存性注入フレームワークを使うだろう
訳案: Spring 等の依存性注入フレームワークを使って大規模なシステムでモックを使ったことがある人は、それがいかに大変かを知っているだろう。
現行訳: 問題は、複数のモジュールに起動ルーチンと停止ルーチンがある場合だ。モジュールから他のモジュールへ委譲するのは、非常に複雑になるのでやりたくない。
訳案: 問題は、起動・停止ルーチンがあるモジュールが複数ある場合だ。ルーチン内から各モジュールが自分以外のモジュールに次々と委譲していくのは、非常に複雑になるのでやりたくない。
現行訳: 少し注意が必要なのは、これらのライフサイクル関数の正確な実行順序は、自分で順番を取り扱うべきだということだ。
trait Magma[A] {
def append(x: A, y: A): A
}
object Magma {
implicit def Monoid[A](implicit m: Monoid[A]) = new Magma[A] {
def append(x: A, y: A) = m.append(x, y)
}
}
@suma
suma / msgpackrpc.md
Last active May 9, 2016 22:59
MessagePack RPCクライアントの振る舞い及びエラー処理

MessagePack RPCクライアントの振る舞い及びエラー処理

概要

MessagePack-RPCのクライアントのエラー処理を正しく、またその後に何をすべきか(可能か)まとめる。 「このエラー起きたとき、どう処理すべきか?」ということを説明する。

説明しないこと:RPCサーバの作り方、各言語のライブラリのプロトコル実装やエラー定義の差。

@studiomohawk
studiomohawk / five-2013-04-03.md
Created April 3, 2013 00:11
CSS Radar @ Twitter / 2013.04.03 Wednesday Edition

CSS Radar - 2013/04/03

JavaScript(記事ではnode.js)におけるコールバックを命令型、Promisesを関数型と捕らえ、node.jsの多くのAPI、モジュールがコールバックを利用している点が欠点となっている解説をしつつ、関数型のアプローチについて、Promisesを使ったアプローチの利点を紹介。

上記の記事に対して、node.jsのエコシステムの今を支えているのがコールバックではないかという反論。関数型アプローチに比べて命令型、コールバックをつかった場合は未来に発生するべき振る舞いをそれらしく表現できる点が多くのプログラマにとって理解しやすいという利点を紹介している。

!SLIDE

Stream Processing Libraries!

@halcat0x15a

!SLIDE

Iteratee

@halcat0x15a
halcat0x15a / TwitterMachine.scala
Last active December 15, 2015 00:28
Twitter User Streams with scala-machines!
import scala.language.postfixOps
import java.io._
import scalaj.http._
import scalaz._, Scalaz._
import scalaz.effect._, Effect._, IO._
import scalaz.concurrent.Promise