Skip to content

Instantly share code, notes, and snippets.

View impressarix's full-sized avatar
💭
Woouw, nice to coding

Dwicahya Sulistyawan impressarix

💭
Woouw, nice to coding
View GitHub Profile
@impressarix
impressarix / metaprogramming_elixir_example.ex
Created April 25, 2018 05:06
Metaprogramming with Elixir
# This is an example of metaprogramming in the Elixir language.
#
# We will define a domain specific language (DSL) for the definition
# of a service which is watched by several sensors.
# Each sensor watches some property/functionality of the service and
# returns the result of the check.
#
# To determine if the service is functioning properly, we need functions
# to run all the sensors' code and gather the returned data.
#