Go through the following from within the project root.
This will:
- Move
~/.ghcto avoid a known bug - Create a user-writable
/appfor building - Clone the halcyon build tool into
/app - Remove any current build artifacts
Go through the following from within the project root.
This will:
~/.ghc to avoid a known bug/app for building/appDoesn't GitHub render smart quotes?
| #!/bin/sh | |
| # | |
| # pbrisbin 2015 - look for markdown links to local images, move them to S3 then | |
| # update the markdown to link to it. | |
| # | |
| # Things to tweak: | |
| # | |
| # - Processes posts/*.md | |
| # - Looks for "/img/image.ext" | |
| # - Puts img/image.ext to s3://$bucket/$(prefix $post)image.ext |
| module Test where | |
| import Control.Applicative | |
| data EitherX a b = LeftX a | RightX b deriving (Eq, Show) | |
| instance Functor (EitherX a) where | |
| fmap f (RightX x) = RightX $ f x | |
| fmap _ (LeftX e) = LeftX e |
Default behavior dictates the following order for ZSH startup files:
/etc/zshenv~/.zshenv/etc/zprofile (if login shell)~/.zprofile (if login shell)/etc/zshrc (if interactive)~/.zshrc (if interactive)/etc/zlogin (if login shell)~/.zlogin (if login shell)| # Connect to a server | |
| redis-cli server | |
| # Make an insert | |
| set key value | |
| # Make multiple insert |
| {-# LANGUAGE OverloadedStrings #-} | |
| module Main where | |
| import Network.Mail.Mime | |
| import Network.Mail.SMTP | |
| import qualified Data.Text.Lazy as TL | |
| -- Get from e.g. `heroku config` | |
| username = "" |
Prerequisites: GHC + cabal-install
Setup project skeleton using hi and my template:
% cabal update
% cabal install hi
% hi \
--module-name "Foo.Bar" \
--package-name "foo" \
--author 'Your Name' \
| 2014-07-17 15:05:03 darthdeus guys I'm getting No instance for (Text.Julius.ToJavascript …Data.ByteString.Lazy.Internal.ByteString) when using aeson's encode ... how should I convert things to json so that I can interpolate them in julius? | |
| 2014-07-17 15:05:38 darthdeus should i unpack the bytestring and pack it into Text? (seems inefficient) | |
| 2014-07-17 15:09:25 darthdeus hmm seems lazy Text doesn't work either | |
| 2014-07-17 15:16:40 darthdeus aaargh, string doesn't work either | |
| 2014-07-17 15:16:55 brisbin String and Text should both be interpolatable | |
| 2014-07-17 15:17:10 darthdeus No instance for (Text.Julius.ToJavascript String) … arising from a use of ‘Text.Julius.toJavascript’ | |
| 2014-07-17 15:17:18 darthdeus after doing this | |
| 2014-07-17 15:17:25 darthdeus let json = TL.unpack $ decodeUtf8 $ encode reports :: String | |
| 2014-07-17 15:17:32 darthdeus inside the .julius file just #{json} | |
| 2014-07-17 15:21:52 brisbin |
| import Data.Monoid | |
| -- A validated record is either errors or it | |
| type Validated a = Either [String] a | |
| -- A validation is the process of taking a record and returning a validated one | |
| newtype Validation a = Validation { runValidation :: (a -> Validated a) } | |
| -- Validation processes are composable as monoids | |
| instance Monoid (Validation a) where |