This file contains hidden or 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
providerName = | |
case global.selectedProvider of | |
Nothing -> "(None)" | |
provider.name | |
-- Same as | |
providerName = Maybe.unwrap "(None)" .name global.selectedProvider |
This file contains hidden or 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
milestoneBtnMsg = | |
global.selectedCareplan -- Start with the careplan | |
|> Maybe.andThen .id -- Call .id on it if it's Just; return Nothing if it's Nothing or id is Nothing | |
|> Maybe.map MilestonesRoute -- Wrap it in a MilestonesRoute if we have a Just | |
|> Maybe.withDefault DoNothing -- If we have a Nothing, return DoNothing; otherwise, return the value in the Just | |
This file contains hidden or 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 exposing (main) | |
import Navigation exposing (program, Location) | |
import Platform.Cmd as Cmd exposing (Cmd) | |
import Platform.Sub as Sub exposing (Sub) | |
import Html exposing (Html) | |
import Html.Attributes as Attr | |
import Html.Events as Event | |
import Routes exposing (Route(..)) | |
import RemoteData exposing (..) |
This file contains hidden or 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 TemplateHaskell #-} | |
{-# LANGUAGE TypeOperators #-} | |
module Lib | |
( startApp | |
, app | |
) where | |
import Data.Aeson | |
import Data.Aeson.TH |
This file contains hidden or 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
robert=# \d+ changeset | |
Table "public.changeset" | |
Column | Type | Modifiers | Storage | Stats target | Description | |
--------+---------+--------------------------------------------------------+---------+--------------+------------- | |
id | integer | not null default nextval('changeset_id_seq'::regclass) | plain | | | |
Indexes: | |
"changeset_pkey" PRIMARY KEY, btree (id) | |
Referenced by: | |
TABLE "state" CONSTRAINT "state_changeset_id_fkey" FOREIGN KEY (changeset_id) REFERENCES changeset(id) | |
This file contains hidden or 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 src="check1.js"></script> | |
<script> | |
var modzrFlash; | |
Check1( | |
"hasFlash", | |
"https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js", | |
function() { | |
return Modernizr.flash; |
This file contains hidden or 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
public enum TimePeriod { | |
ONE_YEAR_AGO(Calendar.YEAR, -1), | |
THREE_MONTHS_AGO(Calendar.MONTH, -3), | |
// and so on... | |
; | |
private int calendarField; | |
private int changeMagnitude; | |
private TimePeriod(int calendarField, int changeMagnitude) { |
This file contains hidden or 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
@CompileStatic | |
abstract class MagnusProperty<T> { | |
final String key; | |
MagnusProperty(String key) { | |
assert key : "No key provided!" | |
this.key = key | |
} |
This file contains hidden or 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
public class ExceptionEater { | |
private static final Logger log = //TODO Create Logger | |
public static <T> Optional<T> swallowNPE(Supplier<T> producer) { | |
try { | |
return Optional.ofNullable(supplier.get()); | |
} catch(NullPointerException npe) { | |
log.info("NullPointerException being swallowed", npe); | |
return Optional.empty(); |
This file contains hidden or 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
public class ExceptionEater { | |
private static final Logger log = //TODO Create Logger | |
public static <T> T swallowNPE(Supplier<T> producer) { | |
try { | |
return supplier.get(); | |
} catch(NullPointerException npe) { | |
log.info("NullPointerException being swallowed", npe); |