Skip to content

Instantly share code, notes, and snippets.

@deckool
deckool / Json.hs
Created May 5, 2018 08:15 — forked from soupi/Json.hs
A simple JSON EDSL
{- | An EDSL for defining and printing JSON values
-}
import Data.List (intercalate)
----------------
-- JSON Model --
----------------
-- | The JSONValue data type represents a JSON Value
@deckool
deckool / gist:a914c7e600d37d4fa7ee67df78374fe8
Created May 6, 2017 12:14 — forked from disnet/gist:4973724
sed - convert literate haskell to plain haskell
sed '
s/^>//
t
s/^ *$//
t
s/^/-- /
' in.lhs > out.hs
@deckool
deckool / node-and-npm-in-30-seconds.sh
Created February 27, 2016 16:01 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@deckool
deckool / Fork.hs
Last active August 29, 2015 14:25 — forked from AlexanderAA/Fork.hs
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
@deckool
deckool / Main.hs
Last active August 29, 2015 14:15 — forked from jbpotonnier/Main.hs
{-# 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
#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
@deckool
deckool / http.hs
Created October 27, 2013 11:01 — forked from owainlewis/Example.hs
-- The lack of documentation for these things is crazy
module HTTPExamples
where
import Network.HTTP
import Control.Applicative
url = "http://www.owainlewis.com"