I use this to run a slapd instance for testing schemata, searched, etc. during development.
mkdir -p schema
#!/bin/sh | |
# | |
# Access a shared secret file. | |
set -eu | |
error() { | |
echo $1 | |
exit 1 | |
} |
module Main where | |
import Control.Applicative | |
import Data.Char | |
import Data.List | |
import Options.Applicative | |
import Options.Applicative.Types | |
-- * Options parsers |
module Main where | |
import Control.Applicative | |
import Data.Char | |
import Data.List | |
import Options.Applicative | |
import Options.Applicative.Types | |
-- * Options parsers |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Control.Applicative | |
import Control.Monad.Except | |
import Control.Monad.IO.Class () | |
import Control.Monad.Reader |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
module Main where | |
import Control.Applicative | |
import Control.Monad.Except | |
import Control.Monad.IO.Class () | |
import Control.Monad.Reader | |
import Control.Monad.Writer |
This is a Literate Haskell file: lines begining with `>` are Haskell | |
code and other lines are just plain old text (Markdown, actually). If | |
you save this file with a `.lhs` extension, the Haskell tools will all | |
run it just like a normal `.hs` file. | |
We're going to generate lists of random numbers and will need a few | |
helpful functions from the standard library: | |
> import Data.List (unfoldr) | |
> import System.Random |
#!/bin/sh | |
# | |
# This script will hold your hand during the process of converting an existing Drupal 7 file field from public to private. | |
# | |
# http://twitter.com/thsutton | |
# http://www.linkedin.com/pub/thomas-sutton/55/391/350 | |
# http://thomas-sutton.id.au/ | |
set -eu |
#!/bin/sh | |
# | |
# fixpacktepubs.sh | |
# | |
# Process the EPUB files in the current directory and recreate them with the | |
# ISBN as the unique value. This script was written because Packt Publishing | |
# sell EPUBs with non-unique unique identifiers and it assumes that the EPUBs | |
# being process are structured like Packt's. | |
# |
splitInto :: Int -> [a] -> [[a]] | |
splitInto n l | |
| n <= 0 = error "splitInto: n < 1" | |
splitInto n [] = [] | |
splitInto n l = case splitAt n l of | |
(c, []) -> [c] | |
(c, r ) -> c:(splitInto n r) |