• Phoenix basic auth exercise

    I started learning Phoenix Framework recently. It’s simplicity is striking! I love it. I think it is a great framework to learn and to play with. Today I would like to show you how to implement basic authorization in Phoenix. It is not part of the Phoenix framework and this...

  • Playing Swarm Simulator with a bot in Elixir (part 2 - some OTP)

    Hello! Welcome to the next part of Swarm Simulator tutorial in Elixir. This time I would like to focus on stability and we will do it by: rewriting the bot to become an OTP Application using GenServer and Supervisor using Supervisor features to automatically recover the game after it crashes...

  • How to use Hash#to_proc in Ruby?

    Hash#to_proc has been introduced in Ruby 2.3.0 release. I really like this method. It reminds obtaining a value from a HashMap in Clojure. => ({:a 1} :a) 1 We simply “call” hash-map with :a keyword as a parameter to get the :a’s keyword value. Thanks to Hash#to_proc method, in Ruby...

  • Playing Swarm Simulator with a BOT in Elixir (part 1)

    Hey! Check out this Swarm Simulator. Wouldn’t that be great to have a fully automated solution to grow the swarm for you? How does it feel to be, you know, the coolest farmer in the neighbourhood using the most fancy farming gadgets? I guarantee you that after finishing this tutorial...