Skip to content

Instantly share code, notes, and snippets.

View amitaibu's full-sized avatar

Amitai Burstein amitaibu

View GitHub Profile
@amitaibu
amitaibu / Model.elm
Created December 23, 2017 18:39
Excerpt of Item's status
{-| These are the the states of an open item. You will notice there is a state
called `GoneTranstion` which exists under the Open. This state is a special case
that really exists only as a transition state. That is, when we want to finish
the sale of an item we cannot decide ourself it it's "sold" or "unsold" - that
is the responsibility of the server. So we will send the server a `gone` request,
which will be later decided if the item is sold or not.
So a `GoneTransition` is a very temporarye state, for until we are clear on the `SoldStatus`.
This also works the other way around. That is, when we are in `ItemClosed` state, the clerk
may still go back to `Going` or `Open` in case there was some mistake or a bid was
placed in the room in the right time.
@amitaibu
amitaibu / Main.elm
Created November 1, 2017 19:15
Rockets
module Main exposing (..)
type alias Rocket =
{}
type alias Point =
{ x : Int, y : Int }
@amitaibu
amitaibu / Main.elm
Created May 15, 2017 18:19 — forked from anonymous/Main.elm
contacts page
module Main exposing (..)
import Html exposing (Html, div, li, text, ul)
import Json.Decode as Json exposing (Decoder, andThen, at, fail, int, list, map, nullable, string, succeed)
import Json.Decode.Pipeline exposing (custom, decode, hardcoded, optional, required)
import String exposing (join)
main : Html a
main =
@amitaibu
amitaibu / Main.elm
Created May 14, 2017 18:22 — forked from anonymous/Main.elm
contacts page
module Main exposing (..)
import Html exposing (Html, div, li, text, ul)
main : Html a
main =
div []
[ div [] [ text <| "Showing contacts for language " ++ toString model.language ]
, viewContacts model.language model.contacts
type alias WrappedItemKeyedbyUUids = Dict UUID (WebData Item)
type alias WrappedItems = Dict ItemId (WebData Item)
type alias Item
type alias Item =
{
label : String
image : String
startingPrice : WebData Int
}
items : Dict ItemId (WebData Item)
$output = $handler->post('', $request);
$bid = entity_load('bid', $output[0]['id'], TRUE);
$this->assertEqual($bid->amount, 200);
type Vocab
= VocabMen String
| VocabWomen
type alias VocabMen =
{ name : string
}
type alias VocabWomen =
{ name : string
permalink: "\/(.*)[^\/]$