Skip to content

Instantly share code, notes, and snippets.

curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--node-ip=127.0.0.1 --write-kubeconfig-mode 644" sh -
package main
import (
"github.com/nareix/joy4/av/avutil"
"github.com/nareix/joy4/av/pubsub"
"github.com/nareix/joy4/format"
"github.com/nareix/joy4/format/rtmp"
)
var queue *pubsub.Queue
data DiceState = Up | Down deriving (Show,Eq)
type DiceStates = [DiceState]
data Result = Win | Lose | Even deriving (Show,Eq)
type Submission = (DiceState,DiceState,DiceState)
count :: Eq a => a -> [a] -> Int
count x = length . filter (==x)
matchAt :: DiceStates -> Submission -> Maybe Int
matchAt diceStates submission = matchAt' diceStates submission 3
@sato-s
sato-s / gitlab.md
Created February 17, 2019 23:53
gitlab ssl更新手順

GitLabSSL更新手順

該当のサーバーで以下のコマンドをたたくと自動的にサーバー内の証明書が新しいものに置き換わる。

cd /opt/letsencrypt/
./letsencrypt-auto renew
@sato-s
sato-s / test.md
Created March 19, 2017 09:12
test.md
<style type="text/css"> h2 { margin-left: 5px; } h3 { margin-left: 5px; } </style> <style> body { counter-reset: counter-h1; } h1 {
@sato-s
sato-s / player.rb
Created December 18, 2016 13:21
ruby warrior player.rb
class Player
DIRECTIONS = [:forward, :right, :backward, :left]
def play_turn(warrior)
@warrior = warrior
if feel_enemy? then
warrior.attack! enemy
elsif injured? then
warrior.rest!
else
warrior.walk! empty
def test
puts "test"
end