Skip to content

Instantly share code, notes, and snippets.

View koyo-miyamura's full-sized avatar

koyo koyo-miyamura

View GitHub Profile
defmodule MergeSort do
def sort(list) do
do_sort(list, 0, length(list))
end
defp do_sort(list, left, right) when right - left == 1 do
Enum.slice(list, left..(right - 1))
end
defp do_sort(list, left, right) do
@koyo-miyamura
koyo-miyamura / isucon10.md
Last active November 21, 2021 00:11
isucon10.md
@koyo-miyamura
koyo-miyamura / quiz.ex
Created November 8, 2019 07:20
2019/11/8 ラウンドテーブルのお題
defmodule Quiz do
@moduledoc """
Documentation for Quiz.
"""
@doc """
Search treasure!!!
## Examples
@koyo-miyamura
koyo-miyamura / comet_comments.js
Last active September 16, 2019 06:54
cometsでコメント数を取得する拡張ブックマークレット
javascript:void function(){document.body.appendChild(document.createElement("script")).src="//comets.nabettu.com/presenter/script.js";document.body.appendChild(document.createElement("script")).appendChild(document.createTextNode("let count = -1;setTimeout(() => {$(document).on('animationstart', '.comment',function(){count++;$('.status').text(`コメント数 ${count}`)})},2000)"));document.body.appendChild(document.createElement("style")).appendChild(document.createTextNode(".status{font-size: 32px !important;}"));}();
@koyo-miyamura
koyo-miyamura / main.go
Last active June 29, 2019 09:17
FlagSetのサンプル
package main
import (
"errors"
"flag"
"fmt"
"os"
)
var (

ラウンドテーブル 20190607 ~ Elixir入門 ~

目次

  • |> Elixir って何?
  • |> GoとElixirのコードを比較してみる
  • |> 「Erlang & Elixir fest 2019」 レポート
  • |> Elixir ハンズオン!
  • |> まとめ
  • |> もっと学びたい人へ

Elixirって何?

@koyo-miyamura
koyo-miyamura / main.go
Created May 5, 2019 09:52
Goでカスタムsort
package main
import (
"fmt"
"sort"
)
type User struct {
Name string
Age int
@koyo-miyamura
koyo-miyamura / main.go
Last active May 4, 2019 08:40
goでテンプレートのサンプル
package main
import (
"log"
"os"
"text/template"
"time"
)
func main() {
package add
// Add add two integer
func Add(a int, b int) int {
return a + b
}
package main
import (
"fmt"
"log"
"net/http"
)
// type app struct {
// Name string