Skip to content

Instantly share code, notes, and snippets.

Junichi Kato j5ik2o

Block or report user

Report or block j5ik2o

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View movie-ticket-modeling.scala
// under construction ...
sealed trait BusinessDaySpec
case object WorkDay extends BusinessDaySpec
case object Holiday extends BusinessDaySpec
sealed trait MovieDaySpec
case object MovieDay extends MovieDaySpec
@okapies
okapies / mastodon-ostatus.md
Last active Mar 25, 2018
Mastodon OStatus API の叩き方
View mastodon-ostatus.md

Mastodon が他のインスタンスと情報交換をする OStatus API の使い方。使ってるだけのユーザは知る必要がない裏側の話。

host-meta

Mastodon インスタンスに対して、RFC6415 が規定する /.well-known/host-meta というパスを要求すると以下の XML が返ってくる.

<?xml version="1.0"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
  <Link rel="lrdd" type="application/xrd+xml" template="https://[MASTODON_HOST]/.well-known/webfinger?resource={uri}"/>
</XRD>
@codesword
codesword / minikube.md
Last active Oct 31, 2019
Installing minikube using xhyve driver
View minikube.md

###Install docker-machine-driver-xhyve docker-machine-driver-xhyve is a docker machine driver plugin for xhyve native OS X Hypervisor. xhyve is a lightweight OS X virtualization solution. In my opinion, it's a far better option than virtualbox for running minikube. ####Brew On MacOS sierra, download latest using

brew install docker-machine-driver-xhyve --HEAD
sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
@mpneuried
mpneuried / Makefile
Last active Dec 5, 2019
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
View Makefile
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@maiha
maiha / gist:9f305fb909fd357eb467
Last active Nov 9, 2016
akka: killとstopとPoisonPillの違い
View gist:9f305fb909fd357eb467
stop: 現在処理中のメッセージを完了させる。それ以外のMailboxに溜まっているメッセージは処理しない
PoisonPill: メッセージの追加なので、投げた時点でたまっているメッセージが処理される (キュー消化+stop)
kill: ActorKilledExceptionが速攻出る(処理中の動作を破棄?)。その後はsupervisorのstrategyに依存(default:stop)。Mailboxはそのまま残る(restartしたactorが継続)
http://stackoverflow.com/questions/13847963/akka-kill-vs-stop-vs-poison-pill
@gakuzzzz
gakuzzzz / gist:8d497609012863b3ea50
Last active Jan 16, 2019
Scalaz勉強会 主要な型クラスの紹介
View gist:8d497609012863b3ea50
@marmotte
marmotte / docker_run
Created Jun 13, 2014
dockerコンテナ起動時にコンテナに振り当てられたIPを取得する docker runのラッパー
View docker_run
#/bin/bash
echo $@
CONTAINER_ID=$(docker run $@)
docker inspect --format='{{.NetworkSettings.IPAddress}}' $CONTAINER_ID
View tetration.py
# -*- coding: utf-8 -*-
from itertools import repeat
foldr = lambda f, xs: reduce(lambda x, y: f(y, x), xs)
applyn = lambda f: lambda n, times: foldr(f, repeat(n, times))
towerN = lambda n: pow if n == 1 else applyn(towerN(n - 1))
tower1 = towerN(1)
tower2 = towerN(2)
@yaakaito
yaakaito / compiled.js
Last active Jan 2, 2016
型とか微妙になってるけど多分こんなん
View compiled.js
var BankAccount = (function () {
function BankAccount(balance) {
this.balance = balance;
}
BankAccount.prototype.increase = function (money) {
var a = _.clone(this);
a.balance += money;
return a;
};
@kyo-ago
kyo-ago / gist:8280903
Last active Jan 2, 2016
JavaScriptでDCI的なものを実装してみた例
View gist:8280903
// 銀行口座
var BankAccount = function (balance) { this.balance = balance; };
BankAccount.prototype.increase = function (money) { this.balance += money; };
BankAccount.prototype.decrease = function (money) { this.balance -= money; };
// ロール: 送信側
var Sender = function () {};
Sender.prototype.send = function (money, to) {
this.decrease(money);
to.onReceived(money, this);
You can’t perform that action at this time.