Skip to content

Instantly share code, notes, and snippets.

View chrisbuttery's full-sized avatar
🏠
Working from home

Chris Buttery chrisbuttery

🏠
Working from home
View GitHub Profile
@chrisbuttery
chrisbuttery / CustomStartApp.elm
Created March 4, 2016 01:51 — forked from danyx23/CustomStartApp.elm
Use ports with customized StartApp and "PortActions"
module CustomStartApp (start, App, Config) where
import Html exposing (Html)
import Effects exposing (Effects, Never)
import Task
type alias Config model action portAction =
{ init : ( model, Effects action, portAction )
, update : action -> model -> ( model, Effects action, Maybe portAction )
@chrisbuttery
chrisbuttery / elm-package.json
Created March 4, 2016 01:51 — forked from danyx23/elm-package.json
Simple example of using Ports in Elm
{
"version": "1.0.0",
"summary": "helpful summary of your project, less than 80 characters",
"repository": "https://github.com/user/project.git",
"license": "BSD3",
"source-directories": [
"."
],
"exposed-modules": [],
"dependencies": {
@chrisbuttery
chrisbuttery / Main.elm
Created February 13, 2016 11:32 — forked from mkulke/Main.elm
Elm: simple rest call
module Main where
import Html exposing (Html, text, p)
import Signal exposing (Address)
import Effects exposing (Effects, Never)
import Json.Decode as Json exposing ((:=))
import StartApp exposing (start)
import Task
import Http
@chrisbuttery
chrisbuttery / introrx.md
Created January 19, 2016 22:07 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@chrisbuttery
chrisbuttery / CountDown.elm
Last active June 22, 2018 08:25
A countdown timer in Elm : elm-lang http://elm-lang.org
module CountDown where
import Graphics.Element exposing (..)
import Time exposing (..)
import String
-- MODEL
minutes = 1
seconds = 30
@chrisbuttery
chrisbuttery / index.js
Created December 2, 2015 00:04
requirebin sketch
// var moment = require("moment");
var moment = require("moment-timezone");
var ct = moment(1449011698428).fromNow();
var la = moment(1449011698428).tz("America/Los_Angeles").format('Z z');
function createNode (text) {
var node = document.createElement('div');
node.textContent = text;
node.style.display = "inline-block";
@chrisbuttery
chrisbuttery / uninstall.sh
Created November 29, 2015 00:16
Uninstall Elm
#!/bin/sh
set -e
echo "Warning: You are about to remove all Elm executables!"
installdir=/usr/local/bin
for bin in elm elm-compiler elm-get elm-reactor elm-repl elm-doc elm-server elm-package elm-make
do
{-|
> ```
Consider a simple model for whether a person has the flu or not. Let F=1
indicate that a person has the flu and F=0 indicate that they don't have the
flu. Let C=1 indicate that the person has a cough and C=0 indicate that they
don't have a cough. Let M=1 indicate that the person has muscle pain and M=0
indicate that they don't have muscle pain. Assume that C and M are conditionally
independent given F so that the probability model is
P(C=c,M=m,F=f)=P(C=c|F=f)P(M=m|F=f)P(F=f).
Suppose that we ask two different doctors to supply probabilities for this model
module Main where
import Signal
import Time exposing (Time, millisecond)
import String
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Effects exposing (Never, Effects)
module SignupForm where
import Http
import Task exposing (Task)
import Json.Decode exposing (succeed)
import Html exposing (..)
import Html.Events exposing (..)
import Html.Attributes exposing (id, type', for, value, class)
import StartApp
import Effects exposing (Effects, Never)