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 OverloadedStrings #-} | |
module Main where | |
import Control.Applicative | |
import Snap.Core | |
import Snap.Util.FileServe | |
import Snap.Http.Server | |
main :: IO () |
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
-- The lack of documentation for these things is crazy | |
module HTTPExamples | |
where | |
import Network.HTTP | |
import Control.Applicative | |
url = "http://www.owainlewis.com" |
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
#Quick cp from http://sekati.com/etc/install-nodejs-on-debian-squeeze | |
# | |
#Needed to install TileMill from MapBox | |
# | |
#Installs node.js which has npm bundled | |
# | |
#Build Dependencies | |
sudo apt-get update && apt-get install git-core curl build-essential openssl libssl-dev |
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
#!/bin/sh | |
echo "deb http://ftp.debian.org/debian sid main" >> /etc/apt/sources.list | |
apt-get update | |
apt-get -t sid install libc6 libc6-dev libc6-dbg | |
echo "Please remember to hash out sid main from your sources list. /etc/apt/sources.list" |
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 OverloadedStrings #-} | |
import System.IO.Streams (InputStream, OutputStream, stdout) | |
import qualified System.IO.Streams as Streams | |
import Network.Http.Client | |
import qualified Blaze.ByteString.Builder.Char8 as Builder | |
import Control.Applicative | |
import Control.Monad | |
import Data.Aeson (FromJSON, parseJSON, (.:)) |
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 qualified Text.DeadSimpleJSON as JSON | |
import Text.DeadSimpleJSON (JSON) | |
main = do | |
let jsonData1 = read "[1,2,4,8,16]" :: JSON | |
print $ show jsonData1 | |
plane = do | |
let jsonData = read "{\"seven\": 7, \"nine\": [1,2,4,8,16]}" |
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
div.post::before { | |
content: attr(data-yearday); | |
color:rgba(255,255,255,0.5); | |
font-size:350%; | |
font-weight:bold; | |
} | |
h1 a { | |
color:white; | |
/* First we need to help some browsers along for this to work. |
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
#!/bin/bash | |
while read oldrev newrev ref | |
do | |
echo "new: $newrev" | |
git show --pretty=format:"The author of %h was %an, %ar%nThe title was >>%s<<%n" | |
if [[ $ref =~ .*/master$ ]]; | |
then | |
echo "Master $ref received. Deploying master branch to production..." | |
GIT_WORK_TREE=~/tap git checkout -f | |
echo "$?" |
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 OverloadedStrings #-} | |
module Main where | |
import Control.Applicative | |
import Snap.Core | |
import Snap.Util.FileServe | |
import Snap.Http.Server | |
import Data.Monoid (mconcat) | |
import Blaze.ByteString.Builder.Char8 | |
import Blaze.ByteString.Builder |
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 Fork ( | |
main | |
) where | |
import Control.Concurrent (forkIO, ThreadId, threadDelay) | |
import Control.Concurrent.STM | |
import Control.Monad | |
import Control.Monad.IO.Class (liftIO) | |
import System.Random |
OlderNewer