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
| version: '3' | |
| services: | |
| nginx: | |
| image: stepankuzmin/nginx-with-redis | |
| ports: | |
| - 8080:80 | |
| volumes: | |
| - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro |
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 { Children } from 'react'; | |
| import type { Node } from 'react'; | |
| const childrenKeys = (children: Node): string[] => | |
| Children.map(children, child => child.key); | |
| const shallowCompareChildren = (prevChildren: Node, newChildren: Node): boolean => { | |
| if (Children.count(prevChildren) !== Children.count(newChildren)) { |
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
| docker run -d \ | |
| --name studio \ | |
| --restart=always \ | |
| --network="host" \ | |
| --add-host 10.10.42.2:10.10.42.2 \ | |
| -p 3000:3000 \ | |
| -v $(pwd):/root \ | |
| stepankuzmin/mapbox-studio-classic |
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
| use std::borrow::Cow; | |
| struct A<'a> { | |
| geometry_column: &'a str, | |
| } | |
| impl<'a> A<'a> { | |
| fn geometry_column_mercator(&self, flag: bool) -> Cow<str> { | |
| if flag { | |
| self.geometry_column.into() | |
| } 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
| const fs = require("fs"); | |
| const geobuf = require("geobuf"); | |
| const Protobuf = require("pbf"); | |
| const pgp = require("pg-promise")(); | |
| const vt = require("vector-tile"); | |
| const db = pgp(process.env.DATABASE_URL); | |
| const tile_with_properties_as_jsonb = `WITH data AS ( | |
| SELECT * FROM (VALUES |
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 { is, isImmutable } from 'immutable'; | |
| import { shouldUpdate, shallowEqual } from 'recompose'; | |
| const shouldUpdateImmutable = shouldUpdate((props, nextProps) => { | |
| const keys = Object.keys(props); | |
| const nextKeys = Object.keys(nextProps); | |
| if (keys.length !== nextKeys.length) { | |
| return true; | |
| } |
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
| select | |
| ST_XMax(geom), | |
| ST_YMax(geom), | |
| * | |
| from gamma.cores_boundaries | |
| where ST_XMax(geom) > 180 OR ST_XMax(geom) < -180 OR ST_YMax(geom) > 90 OR ST_YMax(geom) < -90; |
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 path = require("path"); | |
| const argv = process.argv.slice(2); | |
| const dir = argv[0]; | |
| if (!dir) { | |
| console.log("Usage: node get-first-features.js [dir]"); | |
| process.exit(-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
| sudo sshfs -d -o allow_other -o reconnect -o IdentityFile=/home/stepan/.ssh/id_rsa -o ServerAliveInterval=15 [email protected]:/root/gitlab-backups /srv/gitlab/data/backups |
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 request = require("request-promise"); | |
| const main = async () => { | |
| try { | |
| const { Id, Warnings } = await request({ | |
| method: 'POST', | |
| uri: 'http://unix:/var/run/docker.sock:/v1.24/containers/create', | |
| body: { Image: 'bfirsh/reticulate-splines' }, | |
| headers: { | |
| 'Host': null, |