- キウイ
- バナナ一本
- たまねぎ
- キャベツ(1/4)
- にんじん(1本)
- しょうが
- 納豆
- トマト2個
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 snakeCaseKeys(obj) { | |
const tr = obj => _.transform(obj, (result, value, key) => { | |
result[_.snakeCase(key)] = _.isPlainObject(value) ? tr(value) : value | |
}); | |
return tr(obj); | |
} | |
function camelCaseKeys(obj) { | |
const tr = obj => _.transform(obj, (result, value, key) => { | |
result[_.camelCase(key)] = _.isPlainObject(value) ? tr(value) : value |
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
-- this can be compiled | |
neverText : Html Never | |
neverText = text "never dispatch message" | |
-- this can not be compiled | |
htmlNever : Html msg -> Html Never | |
htmlNever elem = elem |
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> | |
<style> | |
.parent { | |
width: 300px; | |
height: 300px; | |
background: black; | |
padding: 100px; | |
} | |
.draggable { |
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 App exposing (..) | |
import Html exposing (Html, div, text, program) | |
-- MODEL | |
type alias Model = | |
String |
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 Hello exposing (..) | |
import Html exposing (text) | |
import List exposing (take, drop, head) | |
indexOf : a -> List a -> Int | |
indexOf target list = | |
let | |
f target n list = |
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
// Aはpropsで装飾用のコンポーネントを受け取りたい | |
// ただし、装飾用のコンポーネントが必要とするpropsについては関知したくない | |
function A(props) { | |
const Decorator = props.decorator; | |
return ( | |
<div> | |
<Decorator {...props.decoratorProps}>TEST</Decorator> | |
</div> | |
); | |
} |
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
// Aはpropsで装飾用のコンポーネントを受け取りたい | |
// ただし、装飾用のコンポーネントが必要とするpropsについては関知したくない | |
function A(props) { | |
const Decorator = props.decorator; | |
return ( | |
<div> | |
<Decorator>TEST</Decorator> | |
</div> | |
); | |
} |