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
module Main where | |
import Web.Mongrel2 | |
import Control.Monad (forever) | |
import Text.Groom (groom) | |
import Data.Default (def) | |
main :: IO () | |
main = do | |
let b = def { m2_publish = "tcp://127.0.0.1:9996" |
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
body { | |
width: 960px; | |
margin-left: auto; | |
margin-right: auto; | |
} | |
.oxymoron { | |
display:table; | |
width: 100%; | |
border-collapse:collapse; |
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
Copyright (c)2011, Clint Moore | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright | |
notice, this list of conditions and the following disclaimer. |
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
{- | |
CouchDB 0.11.0: | |
[error] [<0.95.0>] attempted upload of invalid JSON undefined | |
[info] [<0.95.0>] 127.0.0.1 - - 'PUT' /honks/cmoore? 400 | |
CouchDB Trunk as of 5/28 - 10:26 PST: | |
[info] [<0.95.0>] 127.0.0.1 - - 'PUT' /honks? 201 | |
[debug] [<0.114.0>] 'PUT' /honks/cmoore? {1,1} | |
Headers: [{'Connection',"keep-alive"}, |
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 Hack | |
import qualified Web.Encodings as Web | |
import Data.ByteString.Lazy.Char8 as BS | |
galleryDispatch ai@(\x -> head (pElements x) -> "u") = | |
case requestMethod (a_env ai) of | |
POST -> do | |
dbg "galleryDispatch: POST on /upload." | |
let env = a_env ai | |
case ((,) <$> lookup "Content-Type" (http env) |
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
galleryDispatch ai@(\x -> head (pElements x) -> "u") = | |
case requestMethod (a_env ai) of | |
POST -> do | |
dbg "galleryDispatch: POST on /upload." | |
let env = a_env ai | |
case ((,) <$> lookup "Content-Type" (http env) | |
<*> lookup "Content-Length" (http env)) of | |
Nothing -> do | |
dbg "Ack!" | |
redirect' "/profile" |
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 Hack | |
import qualified Web.Encodings as Web | |
galleryDispatch ai@(\x -> head (pElements x) -> "u") = | |
case requestMethod (a_env ai) of | |
POST -> do | |
dbg "galleryDispatch: POST on /upload." | |
let env = a_env ai | |
case ((,) <$> lookup "Content-Type" (http env) | |
<*> lookup "Content-Length" (http env)) of |
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
{- No, it's not live. Just testing. :) -} | |
{-# LANGUAGE ViewPatterns #-} | |
galleryDispatch ai@(\x -> head (pElements x) -> "u") = | |
case requestMethod (a_env ai) of | |
POST -> do | |
let env = a_env ai -- Hack's Env | |
case ((,) <$> lookup "Content-Type" (http env) | |
<*> lookup "Content-Length" (http env)) of | |
Nothing -> do |
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
{- Types.hs -} | |
{-# LANGUAGE DeriveDataTypeable #-} | |
module Brazil.Types where | |
import Data.Typeable () | |
import Data.Generics | |
import Text.StringTemplate.GenericStandard () |
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
for f in `cabal list | grep \* | cut -f 2 -d \ `; do cabal fetch $f; done |