Mix.install([
{:assert_match, github: "siiibo/assert_match"}
])
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function uuid() | |
local command = "uuidgen | tr '[:upper:]' '[:lower:]'" | |
local handle, error = io.popen(command) | |
if not handle then | |
return nil, error | |
end | |
local result = handle:read("*a"):gsub("%s", "") | |
handle:close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mix.install([ | |
{:benchee, "~> 1.0", only: :dev}, | |
{:flow, "~> 1.2.0"} | |
]) | |
mapper = fn number -> number * number end | |
Benchee.run(%{ | |
"enum" => fn -> 1..1_0000_000 |> Enum.map(mapper) |> Enum.sum() end, | |
"flow" => fn -> 1..1_0000_000 |> Flow.from_enumerable() |> Flow.map(mapper) |> Enum.sum() end |
$ iex -S mix
Erlang/OTP 24 [erts-12.0.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
Interactive Elixir (1.13.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> B.__info__(:functions)
[bar: 0, foo: 0, hoge: 0, new_bar: 0, new_foo: 0, new_hoge: 0]
iex(2)> B.new_bar()
"geneareted from bar."
iex(3)> B.new_foo()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Remove Label | |
on: | |
issues: | |
types: [closed] | |
jobs: | |
remove_label: | |
runs-on: ubuntu-latest | |
steps: |
プログラミング言語Elixirは、不変的な状態を用いた関数プログラミングと、並行性へのアクターベースのアプローチを、整然とした、モダンな文法の中にラップしたものだ。そして、業務に耐えうる頑健さを持ち、高性能で、分散可能なErlang VM上で動作する。でも、いったいこれって、どういう意味だろう?
これは、今あなたの時間を奪っている。諸々の難しいことについての心配を、やめていいってことだ。もう、マルチスレッド環境でデータの一貫性を守るために頭を絞る必要はない。アプリケーションをどうスケールさせるか、あまり考えなくてよくなる。さらに、これが一番大事なことだが、プログラミングを別のやり方で考えることができるようになる。
point:
- 「プログラミングを別のやり方で考えることができるようになる」がポイント
- マトリックスに「赤いカプセル」ってのが出てくる(らしい)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm i -S @types/google-apps-script | |
cat <<EOF > tsconfig.json | |
{ | |
"compilerOptions": { | |
"lib": ["es2019"], | |
"experimentalDecorators": true | |
} | |
} | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"lib/*.ex": { | |
"alternate": "test/{}_test.exs" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
db: | |
image: postgres:11.8-alpine | |
volumes: | |
- ./docker/db/init:/docker-entrypoint-initdb.d | |
- ./docker/db/data:/var/lib/postgresql/data | |
ports: | |
- "5432:5432" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule AggregaterTest do | |
use ExUnit.Case | |
doctest Aggregater | |
describe "test for Aggregater.counter" do | |
test "シンプルなケース" do | |
assert Aggregater.counter(["A", "B", "C", "D"]) == %{"A" => 1, "B" => 1, "C" => 1, "D" => 1} | |
end | |
test "重複した値がうまくカウントされているか" do |
NewerOlder