Skip to content

Instantly share code, notes, and snippets.

View andersonmcook's full-sized avatar

Anderson Cook andersonmcook

View GitHub Profile
@andersonmcook
andersonmcook / Main.elm
Created August 29, 2018 20:30
tiny elm app
module Main exposing (main)
import Browser
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (onClick, onInput)
import Http
import Json.Decode as Decode exposing (Decoder, field, oneOf, succeed)
import Json.Decode.Pipeline exposing (hardcoded, optional, required)
import Json.Encode as Encode
@andersonmcook
andersonmcook / constants.exs
Last active June 20, 2018 15:33
Naïve approaches to cross-module constants not using config
# use Mix.Config
# config :constants,
# :some_string: "some_string",
# :range_i_like: 1..5,
# :a_map: %{letters: ~w(a b c)}
defmodule Constants.Macro do
# Take code and convert to AST
# Inject name into quoted expression as the name of the macro