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 ScopedTypeVariables #-} | |
import Data.Monoid | |
import Data.List | |
import Debug.Trace | |
import Data.Maybe (fromMaybe) | |
dotrace x = trace (show x) x | |
getPrefs name = (`zip` [1..]) . lines <$> readFile name |
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
git config --global alias.recent "for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'" |
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
(require 'flycheck-haskell-stack) | |
(add-hook 'haskell-mode-hook | |
(lambda () | |
(flycheck-select-checker 'haskell-stack) | |
(flycheck-mode) | |
(whitespace-mode) | |
(haskell-mode-stylish-buffer) | |
)) |
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
d <- Data.Map.fromList . Prelude.map (\x -> (sort x,x)) . Prelude.map (Prelude.filter (\x -> x >= 'a' && x <= 'z')) . lines . Prelude.map toLower <$> readFile "/home/mark/wlist_match10.txt" | |
Data.Map.lookup (sort "ducrletde") d | |
> Nothing |
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 DataKinds #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} | |
module Leadstage.API | |
where |
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
"did you put the bins out Tony love?" | |
"What's important and what I think the Australian people think is important is that I stopped the boats" | |
*internal sigh* "is the dog fed?" | |
"If by dog you mean boats, and by fed you mean stopped, then by jingo yes" | |
"I'm leaving you, Tony" | |
"Not by boat you're not" |
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
csvs = lapply(list.files(pattern="headed$"), read.csv) | |
r=Reduce(function(x,y) {merge(x,y, by="key",all=TRUE)}, csvs[-1], csvs[[1]]) | |
write.csv(r, file="final.csv") |
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
(defun ghc-display-errors-to-minibuf () | |
(let ((file-msgs (ghc-get-errors-over-warnings))) | |
(if (null file-msgs) | |
(message "No errors or warnings") | |
(let* ((file (ghc-file-msgs-get-file file-msgs)) | |
(msgs (ghc-file-msgs-get-msgs file-msgs)) | |
(errmsg (mapconcat 'identity msgs "\n")) | |
(buffile buffer-file-name)) | |
(if (string-equal buffile file) |
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
orb ➜ ~/Downloads cat enwiki-latest-all-titles-in-ns0| time ag tennis > /dev/null | |
ag tennis > /dev/null 1.03s user 0.04s system 99% cpu 1.066 total | |
orb ➜ ~/Downloads cat enwiki-latest-all-titles-in-ns0| time grep tennis > /dev/null | |
grep --color=auto --exclude-dir={.bzr,.cvs,.git,.hg,.svn} tennis > /dev/null 0.19s user 0.02s system 98% cpu 0.219 total | |
orb ➜ ~/Downloads |
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
orb ➜ ~ curl http://localhost:3000/12 | |
<h1>accessed 12 times!</h1>% orb ➜ ~ curl http://localhost:3000/12 | |
<h1>accessed 24 times!</h1>% orb ➜ ~ | |
orb ➜ ~ curl http://localhost:3000/12 | |
<h1>accessed 36 times!</h1>% |