This file contains hidden or 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 OverloadedStrings #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| module Main where | |
| import Data.Aeson | |
| import qualified Data.ByteString.Lazy as BSL | |
| import qualified Data.Text as T | |
| main :: IO () |
This file contains hidden or 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
| -- | given a directory for a paper, read that json file into a Paper value | |
| readPaper :: FilePath -> IO (Maybe Paper) | |
| readPaper fp = do | |
| f <- findPaper fp "paper.json" | |
| let f' = listToMaybe f | |
| bs <- mapM BS.readFile f' -- XXX this gonna be a problem at some point XXX | |
| mapM decodeStrict bs -- is this right? do I need this pure? can I concat it with the previous line? |
This file contains hidden or 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 Web.Scotty | |
| main :: IO () | |
| main = do | |
| scotty 3000 $ do | |
| get "/foo%2C" $ html "you got the url encoded option" | |
| get "/foo," $ html "you got the NOT YET url encoded option" |
This file contains hidden or 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
| ;; haskell | |
| (use-package haskell-mode | |
| :ensure t | |
| :init | |
| (progn | |
| (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode) | |
| (add-hook 'haskell-mode-hook 'turn-on-haskell-indent) | |
| (add-hook 'haskell-mode-hook 'interactive-haskell-mode) | |
| (setq haskell-process-args-cabal-new-repl | |
| '("--ghc-options=-ferror-spans -fshow-loaded-modules")) |
This file contains hidden or 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
| ;;; orgtimer.el --- show org-agenda when emacs is idle for five minutes | |
| ;;; stolen directly from https://www.emacswiki.org/emacs/IdleTimers | |
| ;; variable for the timer object | |
| (defvar idle-timer-org nil) | |
| ;; callback function | |
| (defun idle-timer-org-callback () | |
| (org-agenda-list)) |
This file contains hidden or 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
| data GithubConfig = GC { | |
| username :: Text | |
| , oauth :: Text | |
| } deriving (Show, Eq, Ord) | |
| githubSpec :: ValueSpec GithubConfig | |
| githubSpec = sectionsSpec "github" $ | |
| do username <- reqSection "username" "GitHub username" | |
| oauth <- reqSection "oauth" "OAuth Token for GitHub" | |
| pure GC{..} |
This file contains hidden or 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
| share [mkMigrate "migrateAll", mkPersist sqlSettings] [persistLowerCase| | |
| Paper json | |
| doi Text | |
| author Text | |
| published Day | |
| title Text | |
| Primary doi | |
| UniquePaperDoi doi | |
| deriving Show Generic | |
| Annotation json |
This file contains hidden or 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 OverloadedStrings #-} | |
| module Main where | |
| import Control.Applicative | |
| import Data.Attoparsec.Text | |
| import Data.Char (isLetter) | |
| import qualified Data.Map.Strict as M | |
| import Data.Text hiding (foldr, zipWith) | |
| {- |
This file contains hidden or 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 | |
| -- using http://hackage.haskell.org/package/base-4.12.0.0/docs/System-Environment.html#v:lookupEnv | |
| import System.Environment | |
| main :: IO () | |
| main = do | |
| shell <- lookupEnv "SHELL" -- System.Environment.lookupEnv take a String | |
| doesnotexist <- lookupEnv "DOESNOTEXIST" | |
| print (checkEnvVars shell) |
This file contains hidden or 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
| cabal-version: >=1.10 | |
| name: whonknows | |
| version: 0.1.0.0 | |
| license: BSD3 | |
| license-file: LICENSE | |
| author: Shae Erisson | |
| maintainer: shae@scannedinavian.com | |
| build-type: Simple | |
| extra-source-files: CHANGELOG.md |