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
-- | Parse string | |
-- >>> parse (parseString) "fail" "\"hello 'world' foobar\"" | |
-- Right (String "hello 'world' foobar") | |
-- >>> parse (parseString) "fail" "\"hello \\\"world' \n\r \\\\ foobar\"" | |
-- Right (String "hello \"world' \n\r \\ foobar") | |
parseString :: GenParser Char st Word | |
parseString = do char '"' | |
x <- many $ chars | |
char '"' | |
return $ String x |
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
FROM ubuntu:trusty | |
MAINTAINER Ryan Munro <[email protected]> | |
RUN apt-get update -qq | |
RUN apt-get install -qqy apt-transport-https | |
RUN echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list | |
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
RUN apt-get update -qq | |
RUN apt-get install -qqy lxc-docker |
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 Control.Monad | |
import Control.Applicative | |
instance (Applicative f, Num a) => Num (f a) where | |
-- (+) <$> (return 123) <*> (return 321) now becomes: | |
-- ((return 123) + (return 321)) -- yipee! | |
(+) = liftA2 (+) | |
... |
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
(<<) :: Monad m => m b -> m a -> m b | |
a << b = do | |
va <- a | |
_ <- b | |
return $ va |
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
fetchDependencies: (version, value) -> | |
promises = [] | |
for x in version.dependencies | |
promise = @searchTerm(x.name).then (data) => | |
d = _.first(data) | |
dep_search = _.last(d.versions) | |
if dep_search.scripts.length > 0 | |
el = document.createElement("script") | |
el.setAttribute("data-require", value.name + "@*") | |
el.setAttribute("data-semver", version.semver) |
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
data MyInteger = Zero MyInteger | One MyInteger | End | |
-- | Show integer | |
-- >>> show (One $ One $ Zero $ Zero $ Zero $ End) | |
-- "11000b" | |
-- >>> show (End) | |
-- "b" | |
instance Show MyInteger where | |
show (Zero rest) = "0" ++ show rest | |
show (One rest) = "1" ++ show rest |
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
use std::fmt; | |
#[deriving(Clone)] | |
enum MyInteger { | |
Zero(Box<MyInteger>), | |
One(Box<MyInteger>), | |
End | |
} | |
/** |
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> | |
<title ng-bind="window_title"></title> | |
</head> | |
</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
sudo ln -s /usr/bin/docker /usr/bin/donger |