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
import Graphics.Element exposing (show) | |
import Dict exposing (Dict) | |
type alias Model = Dict String Int | |
initModel : Model | |
initModel = | |
Dict.fromList |
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
import Graphics.Element exposing (show) | |
import Debug | |
import Maybe exposing (..) | |
main = | |
-- Maybe.withDefault crashes every time, because it evaluates both branches first, before passing them to case | |
-- https://github.com/elm-lang/core/blob/4.0.0/src/Maybe.elm#L51 | |
show (withDefault (Debug.crash "Test") (Just 1)) |
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 Actions (Action(NoOp, UpdateModel)) | |
module Actions (Action(..)) | |
where | |
type Action | |
= NoOp | |
| UpdateModel Int |
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
// initialize the Shanghai component which keeps track of | |
// shipping data in and out of the Port of Shanghai. | |
var shanghai = Elm.worker(Elm.Shanghai, { | |
coordinates:[0,0], | |
incomingShip: { name:"", capacity:0 }, | |
outgoingShip: "" | |
}); | |
function logger(x) { console.log(x) } | |
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
{ | |
// http://eslint.org/docs/rules/ | |
"ecmaFeatures": { | |
"arrowFunctions": false, // enable arrow functions | |
"binaryLiterals": false, // enable binary literals | |
"blockBindings": false, // enable let and const (aka block bindings) | |
"classes": false, // enable classes | |
"defaultParams": false, // enable default function parameters | |
"destructuring": false, // enable destructuring |
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
.button { | |
background: #000000; | |
color: #ffffff; | |
line-height: 32px; | |
font-size: 16px; | |
max-width: 100px; | |
width: 100%; | |
text-align: center; | |
cursor: pointer; | |
position: relative; |
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
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
li { | |
@for $i from 1 through 8 { | |
&:nth-of-type(#{$i}) { | |
transition-delay: 0.1s * $i; | |
} | |
} |
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
<div class="block block-1-1"> | |
<img src="//placehold.it/50x50"> | |
</div> | |
<div class="block block-1-2"> | |
<img src="//placehold.it/50x50"> | |
</div> | |
<div class="block block-1-3"> | |
<img src="//placehold.it/50x50"> | |
</div> | |
<div class="block block-2-1"> |
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
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
@for $i from 1 through 6 { | |
&.front:nth-child(#{$i}), &.back:nth-child(#{$i}) { | |
$brick-bg: '../image/brick' + random(6) + '.jpg'; | |
background-image: url($brick-bg); | |
background-size: 100% 100%; | |
} |
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
(function () { | |
'use strict'; | |
function hasOwnProperty(obj, prop) { | |
var proto = obj.__proto__ || obj.constructor.prototype; | |
return (prop in obj) && (!(prop in proto) || proto[prop] !== obj[prop]); | |
} | |
var Button = function (settings) { |