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 React, { PureComponent } from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import { connect } from 'react-redux'; | |
| import { Redirect } from 'react-router-dom'; | |
| import { authorize } from './reducer'; | |
| import { tokenSelector, errorSelector } from './selectors'; | |
| class Login extends PureComponent { | |
| constructor(props) { |
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 { combineReducers } from 'redux' | |
| import { routerReducer } from 'react-router-redux'; | |
| export const AUTH_REQUEST = 'AUTH_REQUEST'; | |
| export const AUTH_SUCCESS = 'AUTH_SUCCESS'; | |
| export const AUTH_FAILURE = 'AUTH_FAILURE'; | |
| export const authorize = (login, password) => ({ | |
| type: AUTH_REQUEST, | |
| payload: { login, password } |
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 React, { PureComponent } from 'react'; | |
| import { connect } from 'react-redux'; | |
| import { Route, Redirect } from 'react-router-dom'; | |
| const Main = ({ token }) => { | |
| if (!token) { | |
| return <Redirect to="/login" />; | |
| } | |
| return <div> You are logged in.</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
| nvm i 4 | |
| npm i -g tl mbtiles tilelive-tmstyle tilelive-mapbox tilelive-http tilejson tilelive-vector | |
| export MAPBOX_ACCESS_TOKEN=<token> | |
| tl copy -z 10 -Z 17 -b "36.9829150439 55.5174350218 38.3547996893 55.9613886664" tmstyle://./Mystreet.tm2 mbtiles://./mystreet.mbtiles |
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
| const params = { | |
| host: { | |
| description: 'PostgreSQL host', | |
| boolean: false | |
| } | |
| }; | |
| // cliParams is a mapping between param keys and a cli param keys | |
| const cliParams = { host: 'host' }; | |
| const envParams = { host: 'PGHOST' }; |
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 Koa = { | |
| type t; | |
| type ctx = {. body : ref string}; | |
| /** [make ()] creates an instance of the Koa class. */ | |
| external make : unit => t = "koa" [@@bs.new] [@@bs.module]; | |
| external listen : t => int => unit = "listen" [@@bs.send]; | |
| external use : t => (ctx => unit) [@bs.uncurry] => unit = "use" [@@bs.send]; | |
| }; |
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
| gdal2tiles.py common.tif | |
| mb-util common common.mbtiles |
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
| const fs = require('fs'); | |
| const iconv = require('iconv-lite'); | |
| const buffer = fs.readFileSync(process.argv[2]); | |
| const csv = iconv.decode(buffer, 'win1251'); | |
| const rows = csv.toString().split('\n'); | |
| const regexp = new RegExp('Заработная плата|Аванс', 'ig'); | |
| const result = rows.slice(1).reduce((acc, row) => { | |
| const values = row.split(';'); |
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
| // @flow | |
| import mapboxgl from 'mapbox-gl'; | |
| import { Record } from 'immutable'; | |
| import type { RecordFactory, RecordOf } from 'immutable'; | |
| type MapStyleProps = { | |
| version: number, | |
| name: ?string, | |
| center: ?[number, number], | |
| zoom: ?number, |
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
| const http = require('http'); | |
| const Pool = require('pg-pool'); | |
| const bluebird = require('bluebird'); | |
| const JSONStream = require('JSONStream'); | |
| const QueryStream = require('pg-query-stream'); | |
| const pool = new Pool({ | |
| user: 'postgres', | |
| host: 'localhost', | |
| database: 'data', |