Skip to content

Instantly share code, notes, and snippets.

View billylanchantin's full-sized avatar

Billy Lanchantin billylanchantin

  • 15:48 (UTC -04:00)
View GitHub Profile
@billylanchantin
billylanchantin / spec.json
Last active October 26, 2023 20:03
Vega-Lite spec from Thu Oct 26 2023
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"config": {
"axis": {
"domain": false,
"grid": false,
"labels": false,
"ticks": false,
"title": ""
},
@billylanchantin
billylanchantin / compare_chain.exs
Last active November 1, 2022 22:45
Proof of concept for compare? macro
defmodule CompareChain do
@valid_ops [:<, :>, :<=, :>=]
defmacro compare?(expr, module) do
ast = quote(do: unquote(expr))
ast
|> Macro.prewalker()
|> Enum.reduce_while([], fn
{op, _, [_left, right]}, acc when op in @valid_ops ->
{:cont, [{op, right} | acc]}
<!DOCTYPE html>
<meta charset="utf-8">
Hello, world!