Skip to content

Instantly share code, notes, and snippets.

module Main where
import Data.List
import Debug.Trace
main = do
input <- getContents
let xs = lines input
putStr "Old rules: "
print (length (filter (allPredicates [atLeastNVowels 3, repeats, not . containsBlacklistedPhrase]) xs))
data Action = On | Off | Toggle deriving (Show, Eq)
data Rectangle = Rectangle Point Point deriving Show
data Point = Point Int Int deriving Show
-- strToInstruction :: String -> Maybe Instruction
-- strToInstruction ('t':'u':'r':'n':' ':'o':'n':xs) = Just (Instruction On (strToRectangle xs))
-- strToInstruction ('t':'u':'r':'n':' ':'o':'f':'f':' ':xs) = Just (Instruction Off (strToRectangle xs))
-- strToInstruction ('t':'o':'g':'g':'l':'e':' ': xs) = Just (Instruction Toggle (strToRectangle xs))
-- strToInstruction x = trace x Nothing
import Text.Read
import Data.Maybe
import Data.List.Split
import Data.Set hiding (map, foldl)
-- S is straight
-- we need S for when we break all of the instructions into length=1 vectors, to support
-- intermediary steps
data Direction = L | R | S deriving (Show, Eq)
data Instruction = Instruction { turnDirection :: Direction, distance :: Int } deriving Show
@travisby
travisby / keybase.md
Created December 27, 2016 02:50
Verifying myself on keybase

Keybase proof

I hereby claim:

  • I am travisby on github.
  • I am travisby (https://keybase.io/travisby) on keybase.
  • I have a public key whose fingerprint is C850 B893 86CC 16A2 747C 56BB B207 ED48 5C38 E0CC

To claim this, I am signing this object:

@travisby
travisby / "export logs" from app
Last active July 31, 2019 11:44
ezio shield lsusb
[ 0.008s] [<background page>.GoogleSmartCard.ConnectorApp.BackgroundMain] [INFO] The Smart Card Connector app (id "abcgpdfdfdkhhcheomjombggpbdbgiao", version 1.2.22.0) background script started. Browser version: "5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36". System time: "7/31/2019, 7:43:39 AM"
[ 0.009s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">] [FINE] Preparing NaCl embed (MIME type: "application/x-pnacl")...
[ 0.011s] [<background page>.GoogleSmartCard.NaclModule<"nacl_module.nmf">] [FINE] Initialized
[ 0.012s] [<background page>.GoogleSmartCard.PcscLiteServerClientsManagement.ReadinessTracker] [FINE] Waiting for the "pcsc_lite_ready" message from the NaCl module...
[ 0.013s] [<background page>.GoogleSmartCard.MessageChannelPool] [FINE] Initialized successfully
[ 0.014s] [<background page>.GoogleSmartCard.PcscLiteServerClientsManagement.PermissionsChecking.ManagedRegistry] [FINE] Loading managed storage data wi