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 List exposing (..) | |
| flatten2D : List (List a) -> List a | |
| flatten2D list = | |
| foldr (++) [] list | |
| -- SAMPLE | |
| flatten2D [[1,2],[3,4],[1,1]] == [1,2,3,4,1,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
| unique : List a -> List a | |
| unique list = | |
| case list of | |
| [] -> | |
| [] | |
| x :: [] -> | |
| x :: [] | |
| x :: xs -> |
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
| ####<title> | |
| ---- | |
| **URL** | |
| <url> | |
| **Methods** | |
| `<method>`|`<method>` | |
| **Data Params** | |
| <body> | |
| **Success Response** | |
| <json_resp> |
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
| withOnStateChangeSub : (model -> Cmd msg) -> (msg -> model -> ( model, Cmd msg )) -> msg -> model -> ( model, Cmd msg ) | |
| withOnStateChangeSub statePort update msg model = | |
| let | |
| ( updatedModel, cmd ) = | |
| update msg model | |
| updatedCmd : Cmd msg | |
| updatedCmd = | |
| if updatedModel == model then |
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 Time exposing (Time) | |
| -- 2017-01-22T17:18:02.921Z -> 2017-01-22T00:00:00.000Z | |
| today : Time -> Time | |
| today time = | |
| time - (toFloat <| rem (round time) (round <| 24.0 * Time.hour)) |
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
| getOneBeforeLast : List a -> Maybe a | |
| getOneBeforeLast list = | |
| case list of | |
| [] -> Nothing | |
| a :: _ :: [] -> Just a | |
| _ :: a -> getOneBeforeLast a | |
| -- getOneBeforeLast [1,2,3,4,5] == [4] |
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
| #1 | |
| -- src/ | |
| -- users/ | |
| -- model.js | |
| -- actions.js | |
| -- views.js | |
| -- exams/ | |
| -- votes/ | |
| -- requests/ |
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
| #!/bin/bash | |
| unset FOO | |
| echo "env: $NODE_ENV" | |
| if [ "$NODE_ENV" == "production" ] | |
| then | |
| export FOO=qux | |
| else |
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
| "dependencies": { | |
| "apollo-client-preset": "^1.0.3", | |
| "expo": "^22.0.2", | |
| "graphql": "^0.11.7", | |
| "graphql-tag": "^2.5.0", | |
| "react": "16.0.0-beta.5", | |
| "react-apollo": "^2.0.1", | |
| "react-native": "^0.49.5", | |
| "react-native-camera": "^0.12.0", | |
| "styled-components": "^2.2.3" |
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 fetch from 'isomorphic-fetch' | |
| export const uploadFile = file => { | |
| const data = new FormData() | |
| data.append('data', file) | |
| return fetch(GRAPHCOOL_FILE_URL, { | |
| method: 'POST', | |
| body: data, | |
| credentials: 'same-origin' |
OlderNewer