Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am neongreen on github.
  • I am green (https://keybase.io/green) on keybase.
  • I have a public key whose fingerprint is E719 6559 1104 D327 9F8E 9DF7 B8E3 5A33 FF52 2710

To claim this, I am signing this object:

@neongreen
neongreen / JSONParser.hs
Last active October 12, 2015 22:57 — forked from zearen/JSONParser.hs
A JSON parser/printer
{-# LANGUAGE NoMonomorphismRestriction, FlexibleContexts #-}
import Data.Functor
import Control.Monad
import Data.List
import qualified Data.Map as M
import Text.Megaparsec
import Text.Megaparsec.Lexer (signed, float, integer)
import qualified Text.Megaparsec.Lexer as L
import System.Random
import Control.Arrow
import Control.Monad
import Text.Printf
run :: Int -> Int -> IO ()
run newPills pillsMin = step newPills pillsMin 1 [] []
step :: Int -> Int -> Int -> [Double] -> [Double] -> IO ()
step newPills pillsMin day pills eaten = do
import Options.Applicative
data Options = Options {
optTimeout :: Maybe Int,
optCommand :: Command }
deriving Show
data Command
-- domains
= ListDomains (Maybe Int)
@neongreen
neongreen / print.hs
Last active July 15, 2016 10:44
Generic print that truncates all Doubles in output
{-# LANGUAGE
RecordWildCards,
MultiWayIf
#-}
import Data.Generics.Uniplate.Data
import System.IO
import GHC.IO.Encoding
import GHC.IO.Buffer
import Text.Printf
import Data.Foldable
import Control.Monad
-- The colors are “True” and “False”, the suits are 0,1,2,3
main = do
-- Just naming the color of neighbor's card will fail in both games
check1 $ \i n0 n1 -> case i of
0 -> n1
@neongreen
neongreen / GoToIssue.user.js
Last active December 4, 2017 16:07
GoToIssue.user.js
// ==UserScript==
// @name Youtrack go-to-issue
// @namespace http://tampermonkey.net/
// @version 0.4
// @description Go to issue quickly
// @author Artyom
// @match https://issues.serokell.io/*
// @match https://iohk.myjetbrains.com/youtrack/*
// @grant none
// ==/UserScript==
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}
import Data.Aeson (ToJSON)
import Data.ByteString (ByteString)
import Data.Map (Map, fromList)
import Data.Monoid ((<>))
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
// ==UserScript==
// @name twist-threads
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Move threads to the right
// @author You
// @match https://twistapp.com/*
// @grant none
// ==/UserScript==