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
--- | |
title: Foobar | |
date: 2015-07-14 | |
--- | |
# This is a title | |
Here I want to write some stuff -- this is a markdown document. | |
And here, I want to include an automatically generated list of stuffs |
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
import Text.Parsec | |
import Text.Parsec.String | |
import Control.Monad | |
-- Below is the Augmented BNF description of the IRC protocol, | |
-- according to RFC 2812, along with parsers written using Parsec | |
-- in Haskell | |
-- Let's start with something simple | |
-- letter = %x41-5A / %x61-7A ; A-Z / a-z |
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
dateCtx :: Context String | |
dateCtx = | |
dateField "date" "%B %e, %Y" | |
<> constField "date" "foobar" |
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
dateCtx :: Context String | |
dateCtx = | |
dateField "date" "%B %e, %Y" | |
<> modificationTimeField "date" "%B %e, %Y" |
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
#!/usr/bin/env bash | |
set -euo pipefail | |
formats=$(youtube-dl -F "$1" | grep -A 1000 format | tail -n +2) | |
# Find the best format if it's there(is it always there?) | |
best=$(grep '(best)' <<< "$formats") | |
# Choose best format if available, otherwise | |
# present choices with dmenu | |
if [[ $? != 0 ]]; then |
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
import Control.Monad.State | |
foo :: StateT Int IO () | |
foo = do | |
get >>= \s -> liftIO . putStrLn $ "state = " ++ show s | |
iterateState | |
liftIO . putStr $ "Please enter q to quit> " | |
c <- liftIO getLine | |
unless (c == "q") foo | |
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
#!/usr/bin/env bash | |
# This will not work with set -e because killing ffmpeg means whole script | |
# ends. | |
set -xuo pipefail | |
dorecord() { | |
local filename="$(date "+%F_%V_%H-%M-%S").webm" | |
local start="$(date "+%s")" |
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
(setq org-agenda-files '("~/notes")) | |
(setq-default org-directory "~/notes") | |
(setq-default org-return-follows-link t) | |
(setq org-default-notes-file (concat org-directory "/todo.org")) | |
(setq org-clock-into-drawer t) | |
(setq org-refile-targets '((nil :maxlevel . 9) | |
(org-agenda-files :maxlevel . 9))) |
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 DeriveFunctor #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
import Control.Monad.State | |
import Control.Monad.Trans.Free | |
import Data.Functor.Identity | |
data Turtle n | |
= MoveForward n | |
| MoveBackwards n | |
| TurnLeft n |
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 DeriveFunctor #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
import Control.Monad.State | |
import Control.Monad.Trans.Free | |
import Data.Functor.Identity | |
data Turtle n | |
= MoveForward n | |
| MoveBackwards n | |
| TurnLeft n |