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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Chrome Speech Synthesis API Demo</title> | |
<script> | |
var utterance | |
function readText() { | |
var text = document.getElementById('textInput').value; | |
utterance = new SpeechSynthesisUtterance(text); |
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
javascript:(function() { | |
var elmDiv = document.createElement("div"); | |
elmDiv.id="elm"; | |
var elmJs = document.createElement("script"); | |
elmJs.src="//bit.ly/2eMDpH9"; | |
elmJs.onload=function() { | |
var node = document.getElementById('elm'); | |
Elm.Main.embed(node); | |
}; |
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 OverloadedStrings #-} | |
{-# LANGUAGE QuasiQuotes #-} | |
module Test where | |
import Data.Aeson | |
import Data.ByteString.Lazy (ByteString) | |
import Data.ByteString.Lazy.Char8 (pack) | |
import HAR.Entry | |
import Text.RawString.QQ (r) -- raw-strings-qq | |
main :: IO () |
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 Tree | |
exposing | |
( Tree(Node) | |
, NodeId | |
, CollapsibleTree | |
, makeTree | |
) | |
--Using http://package.elm-lang.org/packages/folkertdev/elm-state/2.1.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
---- BOILER-PLATEY version I'd like to make more succint - I've got 15 simple union types like this and don't want to declare decoder for each of them like this.. | |
type Severity | |
= INFO | |
| WARN | |
| ERROR | |
decodeSeverity : Decoder Severity | |
decodeSeverity = |
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
type LoanTerm | |
= LessThan Int | |
| Between Int Int | |
| MoreThan Int | |
isLess : LoanTerm -> Bool | |
isLess amt = | |
case amt of | |
LessThan _ -> | |
True |
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 OverloadedStrings #-} | |
import Test.WebDriver.Commands (Selector (ById, ByName), click, closeSession, | |
findElem, openPage, sendKeys) | |
import Test.WebDriver.Config (defaultConfig) | |
import Test.WebDriver.Monad (runSession, runWD) | |
import Test.WebDriver.Session (getSession) | |
-- These commands can be executed one by one in GHCi | |
-- (! Note that this is not a recommended way to use webdriver library | |
-- normally you'd use runSession to hide explicit session handling !) |
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 DataKinds #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE TypeOperators #-} | |
module Main where | |
import Data.Aeson (FromJSON, ToJSON) | |
import Data.Proxy (Proxy (Proxy)) | |
import Data.Text (Text) |
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
#!/usr/bin/env stack | |
-- stack script --resolver lts-10.8 --package http-client-tls,http-conduit,bytestring | |
{-# LANGUAGE OverloadedStrings #-} | |
import qualified Data.ByteString.Lazy.Char8 as L8 | |
import Network.HTTP.Client.TLS (setGlobalManager) | |
import Network.HTTP.Conduit (newManager, tlsManagerSettings) | |
import Network.HTTP.Simple (getResponseBody, getResponseHeader, | |
getResponseStatusCode, httpLBS, | |
setRequestManager) | |
main :: IO () |
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
#!/usr/bin/env stack | |
-- stack script --resolver lts-10.9 --package fsnotify | |
{-# LANGUAGE OverloadedStrings #-} | |
import Control.Concurrent (threadDelay) | |
import Control.Monad (forever) | |
import System.Environment (getArgs) | |
import System.FSNotify (watchTree, withManager) | |
main :: IO () |
OlderNewer