Skip to content

Instantly share code, notes, and snippets.

View stepankuzmin's full-sized avatar
🥡

Stepan Kuzmin stepankuzmin

🥡
View GitHub Profile
@stepankuzmin
stepankuzmin / invalid.geojson
Created December 11, 2018 15:01
non rewindable geojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stepankuzmin
stepankuzmin / README.md
Created January 4, 2019 10:22
Gitlab AutoDevops on DigitalOcean k8s
@stepankuzmin
stepankuzmin / getRandomColors.js
Created January 14, 2019 12:43
Generate random colors from palette
const randomColors = [
'#8dd3c7',
'#ffffb3',
'#bebada',
'#fb8072',
'#80b1d3',
'#fdb462',
'#b3de69',
'#fccde5',
'#d9d9d9',
@stepankuzmin
stepankuzmin / needs_indexes.sql
Created January 16, 2019 19:38
Finding which tables need extra indexes
SELECT relname,
seq_scan,
seq_tup_read,
idx_scan
FROM pg_stat_user_tables
WHERE seq_scan > 0
ORDER BY 3 DESC LIMIT 10;
$ node --experimental-worker index.js
Sorting [ 9, 4, 1, 6, 4, 9, 9, 10, 4, 3 ]
sleeping 9000
sleeping 4000
sleeping 1000
sleeping 4000
sleeping 6000
sleeping 9000
sleeping 9000
@stepankuzmin
stepankuzmin / alex3165-react-mapbox-gl.js
Last active April 2, 2019 14:48
Urbica React MapGL Comparison
import ReactMapboxGl, { Source, Layer } from 'react-mapbox-gl';
const Map = ReactMapboxGl({
accessToken: 'pk...'
});
const SOURCE_OPTIONS = {
type: 'vector',
tiles: ['https://...']
};
https://oauth.vk.com/authorize?client_id=6604724&display=mobile&redirect_uri=https://oauth.vk.com/blank.html&scope=friends,photos,offline,messages&response_type=token&v=5.95
@stepankuzmin
stepankuzmin / docker-compose.yml
Created April 29, 2019 12:26
Docker Compose + Joomla + PostgreSQL + Nginx
version: '3.7'
services:
nginx:
image: nginx:alpine
restart: always
ports:
- 8080:80
volumes:
- ./joomla:/var/www/html
@stepankuzmin
stepankuzmin / parse_waypoints.rs
Last active May 4, 2019 12:02
Parse waypoints with Rust
// https://doc.rust-lang.org/rust-by-example/error/iter_result.html#fail-the-entire-operation-with-collect
use std::num::ParseFloatError;
fn get_waypoints(path: String) -> Result<Vec<Vec<f64>>, ParseFloatError> {
path
.split(';')
.map(|waypoint| waypoint.split(',').map(|c| c.parse::<f64>()).collect())
.collect()
}
@stepankuzmin
stepankuzmin / python3.sh
Created May 19, 2019 16:22
Ubuntu use python3 as default
apt-get update
apt-get install python3
update-alternatives --install /usr/bin/python python /usr/bin/python3 10