Skip to content

Instantly share code, notes, and snippets.

<a share="facebook" data-url="http://www.getringer.com/" class="btn btn-primary">Share to Facebook</a>
<span share="facebook" data-url="http://www.getringer.com/">Shares: {{share_count | humanCount}}</a>
(<<) :: Monad m => m b -> m a -> m b
a << b = do
va <- a
_ <- b
return $ va
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 (+)
...
@munro
munro / Dockerfile
Last active August 29, 2015 14:04
Docker In Dock
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
-- | 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
<link rel="import" href="../smoothie-chart/smoothie-chart.html">
<link rel="import" href="../code-mirror/code-mirror.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../ace-element/ace-element.html">
<polymer-element name="my-element">
<template>
<style>
INFO Response 200 GET /wd/hub/session/1839fbf4-435b-4a73-a75c-8916e461ac7f/alert_text{ state: 'success',
sessionId: '1839fbf4-435b-4a73-a75c-8916e461ac7f',
hCode: 2068511415,
value: 'Image URL',
class: 'org.openqa.selenium.remote.Response',
status: 0 }
HELLO ALERT { state: 'success',
sessionId: '1839fbf4-435b-4a73-a75c-8916e461ac7f',
hCode: 2068511415,
value: 'Image URL',
@munro
munro / parser.hs
Last active August 29, 2015 14:01
-- | [33] IntConstant ::= ('+' | '-')? Digit+
-- >>> parse intConstant "fail" "+123"
-- Right "+123"
--
-- >>> parse intConstant "fail" "0003"
-- Right "0003"
--
-- >>> parse intConstant "fail" "-321"
-- Right "-321"
intConstant :: GenParser Char st String
module Main
import meow
foo : Float
foo = 0.123
hello : Float -- can switch to Float/Int to use the correct one
hello = foo