Skip to content

Instantly share code, notes, and snippets.

@deepakjois
deepakjois / blaze-html.md
Created March 31, 2012 03:43
Comparing blaze-markup and blaze-html benchmarks

blaze-html

./benchmarks/RunHtmlBenchmarks --resamples 10000 -u results.csv
warming up
estimating clock resolution...
mean is 2.045215 us (320001 iterations)
found 22885 outliers among 319999 samples (7.2%)
  13018 (4.1%) low severe
  9867 (3.1%) high severe
@deepakjois
deepakjois / svg_combinators.lhs
Created February 26, 2012 18:20
Ideas for an SVG combinator library
An HTML document constructed using blaze-html looks like this
> page1 :: Html
> page1 = html $ do
> head $ do
> title "Introduction page."
> link ! rel "stylesheet" ! type_ "text/css" ! href "screen.css"
> body $ do
> div ! id "header" $ "Syntax"
> p "This is an example of BlazeHtml syntax."
@deepakjois
deepakjois / installing-ghc7.2-osx10.7.md
Created January 26, 2012 17:53 — forked from beastaugh/installing-ghc7.2-osx10.7.md
Installing GHC 7.2 on Mac OS X 10.7 Lion

Installing GHC 7.2 on Mac OS X

This is a brief and bare-bones guide to getting GHC 7.2 and the cabal-install tool (the two basic things you'll need to do Haskell development) up and running on a new Mac OS X 10.7 install.

The instructions given here worked for me, but YMMV.

@deepakjois
deepakjois / README.md
Created January 26, 2012 17:30 — forked from cartazio/gist:1655271
Installing GHC 7.2.2 and diagrams on OS X Lion

Installing GHC 7.2.2 and diagrams on OS X Lion

Install prerequisites

GHC 7.2.2 64-bit

Make sure you have the 64-bit version of GHC. If you installed GHC using brew install haskell-platform, you are using the 32-bit version which wont work with the instructions below. To install the 64-bit version

  • Follow instructions in this [gist][ghcinstallgist]. However, note that the patch for cabal-install that they point to is not available anymore. There is a similar patch in [this gist][cabalinstallgist], which worked for me. Read [this comment][cabalinstallcomment] for more info on how to apply the patch.
@deepakjois
deepakjois / parser.hs
Created January 22, 2012 08:13
Simple sentence parser
word :: Parser String
word = do{ c <- letter
; do{ cs <- word
; return (c:cs)
}
<|> return [c]
}
sentence :: Parser [String]
sentence = do{ words <- sepBy1 word separator
@deepakjois
deepakjois / new_feature.sh
Created December 13, 2011 04:00
Helper script to create a template for HTML5Please
#!/bin/bash
promptValue() {
read -p "$1"": " val
echo $val
}
feature=
status=
@deepakjois
deepakjois / gist:1429263
Created December 4, 2011 05:20
Simple awk -> sed simplification
commit d2bc95ebf2545b1d86463812f82917d943d8f77b
Author: Deepak Jois <[email protected]>
Date: Sat Dec 3 21:18:13 2011 -0800
complicated awk -> simpler sed
diff --git a/post-fiddle-via-gist.sh b/post-fiddle-via-gist.sh
old mode 100644
new mode 100755
index 328b5bd..fd6d8de
@deepakjois
deepakjois / generate-fiddle.sh
Created December 4, 2011 02:32
A convenient way to generate Github gists and link them to JSFiddle.
#!/bin/sh
# Usage: generate-fiddle <folder>
# Creates a folder and adds some files commonly used with JSFiddle
set -e
# Create folder
mkdir $1
cd $1
@deepakjois
deepakjois / fiddle.css
Created December 4, 2011 02:30
Some Description Here
body { display:none }
@deepakjois
deepakjois / fiddle.css
Created December 4, 2011 02:04
Some Description Here
body { display:none }