(defun slurp-files-in-directory (dir) (interactive) (setq vfiles (directory-files dir (not ‘absolute) “vcf”)) (mapcar insert-file-contents vfiles))
(defun org-random-entry (&optional arg) “Select and goto a random todo item from the global agenda” (interactive “P”) (if org-agenda-overriding-arguments (setq arg org-agenda-overriding-arguments)) (if (and (stringp arg) (not (string-match “\S-” arg))) (setq arg nil)) (let* ((today (org-today)) (date (calendar-gregorian-from-absolute today)) (kwds org-todo-keywords-for-agenda) (lucky-entry nil)
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
require(plyr) | |
table <- read.table("/var/folders/h1/yhtz6g614_g999nh_tb4gj600000gn/T/babel-6520FQ/R-import-652nsG", | |
header=TRUE, | |
row.names=NULL, | |
sep="\t", | |
as.is=TRUE) | |
specs = table | |
require(quantmod) | |
#get US 10y Yield from Fred |
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 ScopedTypeVariables #-} | |
import Prelude | |
import Control.Monad | |
import Control.Monad.IO.Class | |
import Control.Monad.Trans.State.Strict | |
import Control.Monad.Trans.Maybe | |
import Pipes | |
-- import qualified Pipes.Prelude as P | |
import Pipes.Concurrent |
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 Pipes | |
import qualified Pipes.Lift as L | |
import qualified Pipes.Prelude as P | |
import Data.Monoid (Sum) | |
echo = runEffect $ (P.stdin >-> P.stdout) () | |
list = runEffect $ L.execWriterP $ | |
((P.range $ take 5 [1..]) >-> P.toList) () :: IO [Int] |
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
-- game.hs | |
import Control.Concurrent hiding (yield) | |
import Control.Concurrent.Async | |
import Control.Monad | |
import Control.Monad.IO.Class | |
import Control.Monad.Trans.Maybe | |
import Control.Monad.Trans.State.Strict | |
import Pipes |
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 ScopedTypeVariables, OverloadedStrings #-} | |
{-# OPTIONS_GHC -fno-warn-missing-signatures | |
-fno-warn-type-defaults | |
-fno-warn-unused-do-bind | |
#-} | |
{-| Testing basic tcp server concepts and their interaction with pipes | |
TODO: |
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 ScopedTypeVariables, OverloadedStrings #-} | |
{-# OPTIONS_GHC -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-unused-do-bind #-} | |
{-| Testing basic tcp server concepts and their interaction with pipes | |
TODO: | |
- [ ] test usage | |
- [ ] port staying open | |
setSocketOption sock ReuseAddr 1 |
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 ScopedTypeVariables, OverloadedStrings #-} | |
{-# OPTIONS_GHC -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-unused-do-bind #-} | |
{-| Testing basic interaction between | |
- StateT | |
- Pipes, and | |
- tcp server concepts | |
- using inner pipes (pipes within another pipe component with a wider context) | |
-} |
OlderNewer