This file contains 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 Data.Digits | |
carry r i x y | i == 0 = 0 | |
| x + y + carry r (i-1) x y <= r-1 = 0 | |
| True = 1 | |
-- currently works iff x and y have same # of digits, due to zip3 | |
add x y = | |
sum [ (x_i + y_i + carry r i x y)*r^i | (x_i, y_i, i) <- (zip3 xs ys [0..])] |
This file contains 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
object IESupport { | |
/** | |
* Lift strips out HTML comments, including IE conditional comments, so this is a workaround. We can't seem to do this | |
* for the 'html' tag though, due to restrictions in he HTML5 parser that Lift uses. | |
*/ | |
def bodyTag(bodyContent: NodeSeq): NodeSeq = { | |
val bodyTagOpen = Unparsed(""" | |
<!--[if lt IE 7]> <body class="home ie6 ie-lt-7 ie-lt-8 ie-lt-9"> <![endif]--> | |
<!--[if IE 7]> <body class="home ie7 ie-lt-8 ie-lt-9"> <![endif]--> |
This file contains 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
<html> | |
<head> | |
<script type="text/javascript" src="/ajax_request/liftAjax.js"></script> | |
</head> | |
<body> | |
<!-- ... --> | |
<script type="text/javascript"> | |
// <![CDATA[ |
This file contains 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
<html> | |
<!--[if lt IE 7]> <body class="home ie6 ie-lt-7 ie-lt-8 ie-lt-9"> <![endif]--> | |
<!--[if IE 7]> <body class="home ie7 ie-lt-8 ie-lt-9"> <![endif]--> | |
<!--[if IE 8]> <body class="home ie8 ie-lt-9"> <![endif]--> | |
<!--[if IE 9]> <body class="home ie9"> <![endif]--> | |
<!--[if gt IE 9]><!--> <body class="home"> <!--<![endif]--> | |
</html> |
This file contains 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
# Convert README.md (Markdown file) to HTML and include in output #using external Markdown | |
if (!$prevent_xss) { | |
$file_name = "README.md"; | |
my $proj_head_hash = git_get_head_hash($project); | |
my $readme_blob_hash = git_get_hash_by_path($proj_head_hash, "README.md", "blob"); | |
if ($readme_blob_hash) { # if README.md exists | |
print "<div class=\"header\">readme</div>\n"; | |
print "<div class=\"readme page_body\">"; # TODO find/create a better CSS class than page_body |
This file contains 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 TransformListComp #-} | |
-- There are three new keywords: group, by, and using. | |
-- The functions sortWith and groupWith are not keywords; they are ordinary functions that are exported by GHC.Exts.) | |
import GHC.Exts (sortWith, groupWith) | |
--import Data.List (sort) | |
-- actual syntax: http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#generalised-list-comprehensions | |
-- |
This file contains 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 Prelude | |
import Control.Monad.Eff | |
import Data.Array | |
main = | |
let test1 = concat [1, 2, 3] [4, 5, 6] | |
x = 3 | |
in do |
This file contains 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
# install some tools we'll need | |
npm install -g grunt grunt-init bower | |
# install a PureScript project template for use with grunt-init | |
mkdir ~/.grunt-init | |
git clone https://github.com/purescript-contrib/grunt-init-purescript.git ~/.grunt-init/purescript | |
# create a PureScript project from the template and fetch its dependencies | |
mkdir /path/to/your_ps_project | |
cd /path/to/your_ps_project |
This file contains 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
(defun do-something () | |
(interactive) ; not sure if necessary | |
(shell-command "ls") | |
) | |
(defun my-purescript-mode-hook () | |
(message "in purescript-mode-hook...") | |
(add-hook 'write-contents-hooks 'do-something nil t) | |
) |
This file contains 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 sbt._ | |
import sbt.Keys._ | |
import com.earldouglas.xsbtwebplugin.WebPlugin | |
import com.earldouglas.xsbtwebplugin.PluginKeys._ | |
import Tests._ | |
/* | |
// don't monitor dirs when using JRebel | |
scanDirectories := Nil |
OlderNewer