Skip to content

Instantly share code, notes, and snippets.

@dtoma
Last active November 13, 2019 07:53
Show Gist options
  • Save dtoma/c2dd56859a2d10e37f8b1186cb6f7051 to your computer and use it in GitHub Desktop.
Save dtoma/c2dd56859a2d10e37f8b1186cb6f7051 to your computer and use it in GitHub Desktop.
Weekend Projects

Huffman compression tutorial series

Haskell video player

Docopt

Example: https://github.com/bazaar-projects/docopt-ng/blob/master/docopt.py

Ideal output would be:

  • a proper grammar
  • easily extensible code (eg. singledispatch, toolz...)
  • maybe just a front-end for argparse?

Migrate from Chrome to Firefox

Ideal output would be:

Compiler tutorial

Hexdump TUI

Goal: Hexdump TUI

+-----------------------------------------+-----------+
| Hexdump                                 | Files     |
+-----------------------------------------+-----------+
| 00 00 00 00 00 00 00 00 . . . . . . . . | foo.json  |
| 00 00 00 00 00 00 00 00 . . . . . . . . | [Main.hs] |
| 00 00 00 00 00 00 00 00 . . . . . . . . | Lib.hs    |
| 00 00 00 00 00 00 00 00 . . . . . . . . |           |
| 00 00 00 00 00 00 00 00 . . . . . . . . |           |
| 00 00                   . .             |           |
+-----------------------------------------+-----------+

Listing files:

import System.Directory
import Control.Monad

printFiles = getCurrentDirectory >>= getDirectoryContents >>= filterM doesFileExist >>= mapM_ print
printDirs = getCurrentDirectory >>= getDirectoryContents >>= filterM doesDirectoryExist >>= mapM_ print

Using GaloisInc's Hexdump:

putStrLn =<< prettyHex <$> B.readFile "Hexdump.hs"

Not sorted

Not sorted - books

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment