This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE TemplateHaskell #-} | |
module CNth where | |
import Language.Haskell.TH | |
import Data.List | |
cnth :: Int -> Q Exp | |
cnth n = dotE qs | |
where | |
qs = head . reverse . take n . drop 1 $ ads |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Hedis | |
( | |
-- * Application classes | |
HasRedis(..) | |
-- * App-wrapped redis runner | |
, redis | |
-- * Re-export other stuff from "Database.Redis" | |
, module R | |
) where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true; do | |
clear && cabal build && $@ | |
inotifywait -qq -e modify -r src/ *.cabal | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The script utilizes `cabal sandbox` to keep the guts from spilling into system packages. | |
The documentation builder is `standalone-haddock`[1] so you have to install it and put on your PATH first. A `hscolour` have to be installed to provide source links. | |
[1]: https://hackage.haskell.org/package/standalone-haddock | |
[2]: https://hackage.haskell.org/package/hscolour |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## include "/path/to/haskell.nanorc" | |
syntax "haskell" "\.hs$" | |
color green "(\||@|!|:|_|~|=|\\|;|\(|\)|,)" | |
color magenta "(True|False|==|/=|&&|\|\||<|>|<=|>=)" | |
color green "(->|<-|!)" | |
color red "[\n\t](as|case|of|class|data|default|deriving|do|forall|foreign|hiding|if|then|else|import|infix|infixl|infixr|instance|let|in|mdo|module|newtype|qualified|type|where)[ \n\t]" | |
color brightblue "'.'" | |
color brightblue "'\\[ntfr]'" | |
color brightblue ""[^\"]*"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module PlainOldXML where | |
import Network.HTTP.Conduit | |
import Text.XML | |
import Text.XML.Cursor | |
xmlQuery :: Manager -> String -> Document -> IO Cursor | |
xmlQuery manager url doc = do | |
putStrLn "Request:" >> BSL.putStrLn (renderLBS (def { rsPretty = True }) doc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module JSONRPC.Client where | |
import Control.Applicative ((<|>)) | |
import Data.Aeson (encode, decode) | |
import Data.Aeson.Types | |
import Network.HTTP.Conduit | |
import qualified Data.Text as T | |
import qualified Data.ByteString.Lazy.Char8 as BSL | |
data (FromJSON a) => JSONRPCReply a = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Debug | |
import Graphics.Input as Input | |
import Html | |
import Html (..) | |
import Html.Attributes (..) | |
import Html.Events (..) | |
import Html.Tags (..) | |
import Http | |
import Window |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: | |
# $ wget http://hipstername.tld/download/linux-x64/scarf && chmod +x scarf | |
# $ ./scarf gist:wiz/c32460e1ecbf612bb12f | |
title: Demo template | |
source: github:login/reponame | |
params: | |
- key: spam | |
title: Spam |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Html (..) | |
import Html.Attributes (..) | |
import Html.Events (..) | |
import List | |
import LocalChannel as LC | |
import Signal | |
-- Model |