Skip to content

Instantly share code, notes, and snippets.

@jswanner
jswanner / canary.rb
Last active August 29, 2015 14:06 — forked from mclosson/canary.rb
# https://blog.spideroak.com/20140814060007-status-reports-transparency-overall-safety
# https://spideroak.com/canary
# https://en.wikipedia.org/wiki/Warrant_canary
# https://www.eff.org/deeplinks/2014/04/warrant-canary-faq
# https://en.wikipedia.org/wiki/National_security_letter
#
# SpiderOak now maintains a warrant canary so they can passively let their users know
# if they have been served a National Security Letter or other legal tool which
# prevents them from actively disclosing to their users that they are being coerced
# or forced into compromising the security or privacy of their userbase.
@jswanner
jswanner / 1-parser.ex
Last active December 3, 2023 00:17 — forked from faried/day2parser.ex
AoC 2023 Day 2 NimbleParsec Parser
defmodule Parser do
import NimbleParsec
game_id = ignore(string("Game ")) |> integer(min: 1, max: 4) |> unwrap_and_tag(:id)
red = replace(string("red"), :red)
green = replace(string("green"), :green)
blue = replace(string("blue"), :blue)
color = choice([red, green, blue])