Skip to content

Instantly share code, notes, and snippets.

View stepankuzmin's full-sized avatar
🥡

Stepan Kuzmin stepankuzmin

🥡
View GitHub Profile
@stepankuzmin
stepankuzmin / keymap.cson
Created April 22, 2016 07:53
Atom editor rename file keybinding
'atom-workspace':
'cmd-shift-m': 'tree-view:rename'
insert into routes_stops (route_id, trajectory_id, direction_id, stop_id, "order")
select
r.route_id as route_id,
r.trajectory_id as trajectory_id,
r.direction_id as direction_id,
s.stop_id as stop_id,
st_linelocatepoint(st_linemerge(r.geom), s.geom) as "order"
from routes r
inner join trajectories_stop_places tsp
on tsp.trajectory_id = r.trajectory_id
select
distinct on(s.stop_id)
r.route_number,
r.route_id,
s.stop_id,
s.stop_name_long,
rs."order",
s.geom as geom
from routes r
inner join routes_stops rs on
@stepankuzmin
stepankuzmin / regions2010_sib_10.json
Last active August 17, 2016 10:21
Генерализованные слои границ субъектов РФ (порог 10 000 метров)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stepankuzmin
stepankuzmin / galton.sh
Created August 25, 2016 18:25
OSRM + Galton
#!/bin/bash
instances=(
amsterdam_netherlands
beijing_china
berlin_germany
madrid_spain
moscow_russia
london_england
new-york_new-york
@stepankuzmin
stepankuzmin / filter.js
Created September 29, 2016 12:05
Filter out MultiPolygon geometries based on area size
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const turf = require('turf');
if (process.argv.length <= 2) {
console.log(`Usage: ${__filename} input output`);
process.exit(-1);
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.js"></script>
<script src="http://kartena.github.io/Proj4Leaflet/lib/proj4-compressed.js"></script>
<script src="http://kartena.github.io/Proj4Leaflet/src/proj4leaflet.js"></script>
function compose() {
var fns = [].slice.call(arguments);
return function() {
var args = [].slice.call(arguments);
var result = fns.reduceRight(function(acc, fn) {
return [fn.apply(null, acc)];
}, args);
return result[0];
}
}
import React, { Component } from 'react';
import mapboxgl from 'mapbox-gl/dist/mapbox-gl.js';
const accessToken = 'pk.eyJ1IjoiaHVtYW5zIiwiYSI6ImNpcDZzdm80cjAwMTB1d203ZmRqZTdwbWEifQ.up9_Pt9XqDhp6m0KLHcbIw';
class Map extends Component {
componentDidMount() {
mapboxgl.accessToken = accessToken;
const map = new mapboxgl.Map({
container: 'map',