Skip to content

Instantly share code, notes, and snippets.

View reoring's full-sized avatar
🏢
work at office

reoring reoring

🏢
work at office
View GitHub Profile
@xrl
xrl / lease.rs
Created July 30, 2021 20:58
Using rust kube-rs to check, poll, and renew advisory locks in Kubernetes
use k8s_openapi::api::coordination::v1::{Lease as KubeLease, LeaseSpec as KubeLeaseSpec};
use chrono::{Local, Utc};
use k8s_openapi::apimachinery::pkg::apis::meta::v1::MicroTime;
use std::time::Duration;
use kube::api::{PatchParams, PostParams, ObjectMeta};
use kube::Api;
use tokio::task::JoinHandle;
use tokio::sync::oneshot::Sender;
const LEASE_DURATION_SECONDS: u64 = 5;
@suin
suin / README.md
Last active May 14, 2018 12:32
iTerm2の背景をポケモンにできるツールLazoCoder/Pokemon-Terminalの日本語ローマ字版データです。

iTerm2の背景をポケモンにできるツールLazoCoder/Pokemon-Terminalの日本語ローマ字版データです。英語名のポケモンじゃ分からない人向けです。例えば、イーブイにしたいときpokemon eeveeと打たないといけないところが、このデータをインストールするとpokemon i-buiでできるようになります。

インストール方法

Pokemon-Terminalをインストールした後に次のコマンドを実行して、ポケモン名データを書き換えてください

wget https://gist.githubusercontent.com/suin/7ba1e2b7a1feb5d0c01a6756f736d24d/raw/b210c99b105cf1a4a6854a55cf3d2f95dc981eba/pokemon.txt -O $HOME/.Pokemon-Terminal/Data/pokemon.txt
@rail44
rail44 / ergodox.pdf
Last active May 21, 2018 01:48
Ergodox User Meetup
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hamaco
hamaco / _shouldbee
Last active August 29, 2015 14:16
ShouldBee コマンド補完ファイル
#compdef shouldbee
function _shouldbee () {
local context curcontext=$curcontext state line
declare -A opt_args
local ret=1
_arguments -C \
'(-h --help)'{-h,--help}'[show help]' \
'(-v --version)'{-v,--version}'[print the version]' \
@awekuit
awekuit / FreeMonad_blog_1.scala
Last active August 29, 2015 14:10
型引数の基本から学ぶ、FreeモナドとCoyoneda http://awekuit.hatenablog.com/entry/2014/12/04/091402
import scala.language.higherKinds
import scala.language.implicitConversions
import scala.language.reflectiveCalls
trait Functor[F[_]] {
def map[A, B](m: F[A])(f: A => B): F[B]
}
implicit def functorOps[F[_] : Functor, A](self: F[A]) = new {
def map[B](f: A => B): F[B] = implicitly[Functor[F]].map(self)(f)
@okumin
okumin / akka-persistence.md
Created September 28, 2014 08:55
akka-persistenceのプラグインをつくろう
@gakuzzzz
gakuzzzz / gist:8d497609012863b3ea50
Last active January 12, 2021 12:50
Scalaz勉強会 主要な型クラスの紹介
lazy val infra = project
lazy val domainInterface = project // interfaceのみを定義。infraに依存しないのがポイント
lazy val domainImpl = project.dependsOn(infra, domainInterface) // domainの実装定義
lazy val app = project.dependsOn(domainInterface) // アプリケーション層は、原理的にinfraに触れないようにする
lazy val program = project.dependsOn(app, domainImpl) // 全部を合成。ここは合成するためのコードのみを置く場所であり、ここに処理はできるだけ書かない