Skip to content

Instantly share code, notes, and snippets.

View tetiana12345678's full-sized avatar
🏠
Working from home

Tetiana tetiana12345678

🏠
Working from home
View GitHub Profile
@tetiana12345678
tetiana12345678 / chatter_bot.md
Last active December 23, 2021 09:28
Building simple chat bot with Elixir (part 2 of building a chat app with Phoenix Channels)

This is part of building a chat app with Phoenix Channels workshop. In this part we will use Elixir to build a chat bot.

Create a new Bot application

Remember in part 1 we generated root for the umbrella application? Generate new application for chat bot:

$ cd chatter/apps
$ mix new bot

Using umbrella applications provided by Elixir we can desing for deletability, one of the great ideas Greg Young was talking about. Let's stop here for a second and think about boundaries, microservices and how to get it right.

@tetiana12345678
tetiana12345678 / chatter.md
Last active November 8, 2017 15:42
Building a chat app with Elixir and Phoenix

Create new umbrella application

$ mix new chatter --umbrella
$ cd chatter

Create new Phoenix Project

$ cd apps
I have a challenge of transforming the data from 1 state to another. I have written my implementation, but I know it could be done, just could’t figure it out. I was looking into using Streams, but struggling to implement it. Any suggestions?
input = [["foo", 56, "0", "1"],
["bar", 34, "2", "3"],
["bla", 90, "2", "1"],
["hey", 10, "4", "1"]]
output = [%{"0" => [56]},
%{"2" => [90, 34]},
%{"4" => [10]}

Keybase proof

I hereby claim:

  • I am tetianahogg on github.
  • I am tetiana12345678 (https://keybase.io/tetiana12345678) on keybase.
  • I have a public key whose fingerprint is 612A 3BD5 9FED EDFB 7F09 D241 B7E2 6107 216C F2D0

To claim this, I am signing this object: