I hereby claim:
- I am adamu on github.
- I am adamu (https://keybase.io/adamu) on keybase.
- I have a public key ASCKIyMyzBSZA7bnIWrtEQaV21Fgu91gFppiDEmvK3k6Ewo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Elixir is a beautiful language. Among its strength is its powerful pattern matching system which allows one to write very declarative, elegant code. FizzBuzz is a trivial problem often presented to new programmers or interviewees to determine baseline programming ability. Here is a solution Elixir:
defmodule FizzBuzz do
| 🇦🇦 | 🇦🇧 | 🇦🇨 | 🇦🇩 | 🇦🇪 | 🇦🇫 | 🇦🇬 | 🇦🇭 | 🇦🇮 | 🇦🇯 | 🇦🇰 | 🇦🇱 | 🇦🇲 | 🇦🇳 | 🇦🇴 | 🇦🇵 | 🇦🇶 | 🇦🇷 | 🇦🇸 | 🇦🇹 | 🇦🇺 | 🇦🇻 | 🇦🇼 | 🇦🇽 | 🇦🇾 | 🇦🇿 | 🇧🇦 | 🇧🇧 | 🇧🇨 | 🇧🇩 | 🇧🇪 | 🇧🇫 | 🇧🇬 | 🇧🇭 | 🇧🇮 | 🇧🇯 | 🇧🇰 | 🇧🇱 | 🇧🇲 | 🇧🇳 | 🇧🇴 | 🇧🇵 | 🇧🇶 | 🇧🇷 | 🇧🇸 | 🇧🇹 | 🇧🇺 | 🇧🇻 | 🇧🇼 | 🇧🇽 | 🇧🇾 | 🇧🇿 | 🇨🇦 | 🇨🇧 | 🇨🇨 | 🇨🇩 | 🇨🇪 | 🇨🇫 | 🇨🇬 | 🇨🇭 | 🇨🇮 | 🇨🇯 | 🇨🇰 | 🇨🇱 | 🇨🇲 | 🇨🇳 | 🇨🇴 | 🇨🇵 | 🇨🇶 | 🇨🇷 | 🇨🇸 | 🇨🇹 | 🇨🇺 | 🇨🇻 | 🇨🇼 | 🇨🇽 | 🇨🇾 | 🇨🇿 | 🇩🇦 | 🇩🇧 | 🇩🇨 | 🇩🇩 | 🇩🇪 | 🇩🇫 | 🇩🇬 | 🇩🇭 | 🇩🇮 | 🇩🇯 | 🇩🇰 | 🇩🇱 | 🇩🇲 | 🇩🇳 | 🇩🇴 | 🇩🇵 | 🇩🇶 | 🇩🇷 | 🇩🇸 | 🇩🇹 | 🇩🇺 | 🇩🇻 | 🇩🇼 | 🇩🇽 | 🇩🇾 | 🇩🇿 | 🇪🇦 | 🇪🇧 | 🇪🇨 | 🇪🇩 | 🇪🇪 | 🇪🇫 | 🇪🇬 | 🇪🇭 | 🇪🇮 | 🇪🇯 | 🇪🇰 | 🇪🇱 | 🇪🇲 | 🇪🇳 | 🇪🇴 | 🇪🇵 | 🇪🇶 | 🇪🇷 | 🇪🇸 | 🇪🇹 | 🇪🇺 | 🇪🇻 | 🇪🇼 | 🇪🇽 | 🇪🇾 | 🇪🇿 | 🇫🇦 | 🇫🇧 | 🇫🇨 | 🇫🇩 | 🇫🇪 | 🇫🇫 | 🇫🇬 | 🇫🇭 | 🇫🇮 | 🇫🇯 | 🇫🇰 | 🇫🇱 | 🇫🇲 | 🇫🇳 | 🇫🇴 | 🇫🇵 | 🇫🇶 | 🇫🇷 | 🇫🇸 | 🇫🇹 | 🇫🇺 | 🇫🇻 | 🇫🇼 | 🇫🇽 | 🇫🇾 | 🇫🇿 | 🇬🇦 | 🇬🇧 | 🇬🇨 | 🇬🇩 | 🇬🇪 | 🇬🇫 | 🇬🇬 | 🇬🇭 | 🇬🇮 | 🇬🇯 | 🇬🇰 | 🇬🇱 | 🇬🇲 | 🇬🇳 | 🇬🇴 | 🇬🇵 | 🇬🇶 | 🇬🇷 | 🇬🇸 | 🇬🇹 | 🇬🇺 | 🇬🇻 | 🇬🇼 | 🇬🇽 | 🇬🇾 | 🇬🇿 | 🇭🇦 | 🇭🇧 | 🇭🇨 | 🇭🇩 | 🇭🇪 | 🇭🇫 | 🇭🇬 | 🇭🇭 | 🇭🇮 | 🇭🇯 | 🇭🇰 | 🇭🇱 | 🇭🇲 | 🇭🇳 | 🇭🇴 | 🇭🇵 | 🇭🇶 | 🇭🇷 | 🇭🇸 | 🇭🇹 | 🇭🇺 | 🇭🇻 | 🇭🇼 | 🇭🇽 | 🇭🇾 | 🇭🇿 | 🇮🇦 | 🇮🇧 | 🇮🇨 | 🇮🇩 | 🇮🇪 | 🇮🇫 | 🇮🇬 | 🇮🇭 | 🇮🇮 | 🇮🇯 | 🇮🇰 | 🇮🇱 | 🇮🇲 | 🇮🇳 | 🇮🇴 | 🇮🇵 | 🇮🇶 | 🇮🇷 | 🇮🇸 | 🇮🇹 | 🇮🇺 | 🇮🇻 | 🇮🇼 | 🇮🇽 | 🇮🇾 | 🇮🇿 | 🇯🇦 | 🇯🇧 | 🇯🇨 | 🇯🇩 | 🇯🇪 | 🇯🇫 | 🇯🇬 | 🇯🇭 | 🇯🇮 | 🇯🇯 | 🇯🇰 | 🇯🇱 | 🇯🇲 | 🇯🇳 | 🇯🇴 | 🇯🇵 | 🇯🇶 | 🇯🇷 | 🇯🇸 | 🇯🇹 | 🇯🇺 | 🇯🇻 | 🇯🇼 | 🇯🇽 | 🇯🇾 | 🇯🇿 | 🇰🇦 | 🇰🇧 | 🇰🇨 | 🇰🇩 | 🇰🇪 | 🇰🇫 | 🇰🇬 | 🇰🇭 | 🇰🇮 | 🇰🇯 | 🇰🇰 | 🇰🇱 | 🇰🇲 | 🇰🇳 | 🇰🇴 | 🇰🇵 | 🇰🇶 | 🇰🇷 | 🇰🇸 | 🇰🇹 | 🇰🇺 | 🇰🇻 | 🇰🇼 | 🇰🇽 | 🇰🇾 | 🇰🇿 | 🇱🇦 | 🇱🇧 | 🇱🇨 | 🇱🇩 | 🇱🇪 | 🇱🇫 | 🇱🇬 | 🇱🇭 | 🇱🇮 | 🇱🇯 | 🇱🇰 | 🇱🇱 | 🇱🇲 | 🇱🇳 | 🇱🇴 | 🇱🇵 | 🇱🇶 | 🇱🇷 | 🇱🇸 | 🇱🇹 | 🇱🇺 | 🇱🇻 | 🇱🇼 | 🇱🇽 | 🇱🇾 | 🇱🇿 | 🇲🇦 | 🇲🇧 | 🇲🇨 | 🇲🇩 | 🇲🇪 | 🇲🇫 | 🇲🇬 | 🇲🇭 | 🇲🇮 | 🇲🇯 | 🇲🇰 | 🇲🇱 | 🇲🇲 | 🇲🇳 | 🇲🇴 | 🇲🇵 | 🇲🇶 | 🇲🇷 | 🇲🇸 | 🇲🇹 | 🇲🇺 | 🇲🇻 | 🇲🇼 | 🇲🇽 | 🇲🇾 | 🇲🇿 | 🇳🇦 | 🇳🇧 | 🇳🇨 | 🇳 |
|---|
This is my entry for the fukuoka.ex Elixir/Phoenix Advent Calendar 2019 day 13, and it's a guide for how to write a Line bot using Elixir. 🧪🤖🧪
First you need to create a Messaging API Channel on the Line Developers Console. You will also need to add your bot as a friend, and know the generated Channel ID and Channel Secret.
Create a new Elixir app with a supervision tree:
mix new advent --sup
cd advent
If you want to use git, now we can create a repository (optional):
これはfukuoka.ex Elixir/Phoenix Advent Calendar 2019の13日の記事です。 ElixirでLineのチャットボットを作る方法を紹介します。 🧪🤖🧪
昨日はsanpo_shihoさんの「Rails経験者に贈るPhoenix入門」でした。
| version: '3.8' | |
| services: | |
| db: | |
| image: postgres | |
| restart: always | |
| ports: | |
| - '5432:5432' | |
| environment: | |
| POSTGRES_PASSWORD: postgres | |
| volumes: |
| #! /usr/bin/env elixir | |
| Mix.install([:benchee]) | |
| string = for i <- 0x1F600..0x1F64F, into: "", do: <<i::utf8>> | |
| codepoints = fn -> string |> String.codepoints() |> length end | |
| charlist = fn -> string |> String.to_charlist() |> length end | |
| comprehension = fn -> for <<_::utf8 <- string>>, reduce: 0, do: (count -> count + 1) end | |
| Benchee.run( |