This file contains 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
const express = require('express'); | |
const fs = require('fs'); | |
const cors = require('cors'); | |
const _ = require('lodash'); | |
const PORT = process.env.PORT || 5000; | |
const buffer = fs.readFileSync('./data.json'); | |
const { flights } = JSON.parse(buffer); | |
const carriers = _.uniq(flights.map(flight => flight.carrier)); |
This file contains 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
const express = require('express'); | |
const fs = require('fs'); | |
const cors = require('cors'); | |
const _ = require('lodash'); | |
const PORT = process.env.PORT || 5000; | |
const buffer = fs.readFileSync('./data.json'); | |
const { flights } = JSON.parse(buffer); | |
const carriers = _.uniq(flights.map(flight => flight.carrier)); |
This file contains 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
// @flow | |
import React, { Component } from 'react'; | |
import Dialog from 'material-ui/Dialog'; | |
import TextField from 'material-ui/TextField'; | |
import FlatButton from 'material-ui/FlatButton'; | |
import { inject, observer } from 'mobx-react'; | |
import { DateRangePicker } from 'react-dates'; | |
import moment from 'moment'; | |
import RaisedButton from 'material-ui/RaisedButton'; |
This file contains 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
/* ------------------------------------------------------------------------------ | |
* routes.jsx | |
* | |
* main routing config file | |
* | |
* Nick Luparev [email protected] | |
------------------------------------------------------------------------------- */ | |
import React from 'react'; | |
import { Route, IndexRoute, IndexRedirect } from 'react-router'; | |
import App from '../components/App'; |
This file contains 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 { goBack, push } from 'react-router-redux'; | |
import { loadProducts } from '../ProductsContainerPage/actions'; | |
import { submitData } from './api'; | |
import { | |
CREATE_PRODUCT, | |
CREATE_PRODUCT_SUCCEEDED, | |
CREATE_PRODUCT_FAILED, | |
} from './constants'; | |
export const handleCancel = () => dispatch => dispatch(goBack()); |
This file contains 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 Html exposing (..) | |
import Html.Attributes exposing (class) | |
import Html.App exposing (program) | |
import Html.Events exposing (onClick) | |
import Random | |
main = | |
program | |
{ init = init | |
, view = view |
This file contains 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 Html exposing (text) | |
import Json.Decode exposing (..) | |
decodeIds : Decoder (List Int) | |
decodeIds = list int | |
convertIds : String -> Decoder (List Int) -> Result String (List Int) | |
convertIds str decoder = | |
decodeString decoder str |
This file contains 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 Data.Char | |
import Data.List | |
sumCows :: (Eq a, Num b) => [a] -> [a] -> b | |
sumCows [] _ = 0 | |
sumCows _ [] = 0 | |
sumCows (x:xs) (y:ys) = current + sumCows (xs++[x]) ys | |
where | |
current = (if (x /= y) && (elem y xs) then 1 else 0) |
This file contains 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
qsort [] = [] | |
qsort (x:xs) = smaller ++ [x] ++ larger | |
where | |
smaller = qsort . filter (<=x) $ xs | |
larger = qsort . filter (>x) $ xs | |
reverse' [] = [] | |
reverse' (x:xs) = reverse xs ++ [x] | |
reverse2 xs = foldr (\x acc -> x : acc) [] xs |
This file contains 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
var R = require('ramda'); | |
var multiply = R.curry(function(x, y) { | |
return x * y; | |
}); | |
var double = multiply(2); | |
var splitOnI = R.split('i'); | |
splitOnI('mississippi'); |
NewerOlder