Skip to content

Instantly share code, notes, and snippets.

@rodrigues
rodrigues / euro-exchange.livemd
Last active August 10, 2023 13:45
💶 Euro Exchange Rates History 📈

💶 Euro Exchange Rates History

Run in Livebook

Mix.install([
  {:briefly, "~> 0.4.1"},
  {:req, "~> 0.3.10"},
## 1. connecting to MongooseIM from Elixir with escalus hex package
user_spec = [
username: @username,
password: @password
]
config = []
config = :escalus_cleaner.start(config)
# this connects to MIM and returns a client you
defmodule TTTMap do
def win?(%{s1: x, s2: x, s3: x}) when not is_nil(x), do: true
def win?(%{s4: x, s5: x, s6: x}) when not is_nil(x), do: true
def win?(%{s7: x, s8: x, s9: x}) when not is_nil(x), do: true
def win?(%{s1: x, s4: x, s7: x}) when not is_nil(x), do: true
def win?(%{s2: x, s5: x, s8: x}) when not is_nil(x), do: true
def win?(%{s3: x, s6: x, s9: x}) when not is_nil(x), do: true
def win?(%{s1: x, s5: x, s9: x}) when not is_nil(x), do: true
def win?(%{s3: x, s5: x, s7: x}) when not is_nil(x), do: true
def win?(_), do: false
@rodrigues
rodrigues / rem_shell.ex
Last active January 28, 2019 22:34
`RemShell.print_instructions("myhost.com")`
defmodule RemShell do
import IO.ANSI, only: [underline: 0, bright: 0, reset: 0]
@moduledoc """
Outputs commands to run a remote shell
from your machine to a remote host.
"""
# TODO replace with real values
@app :kebab