Skip to content

Instantly share code, notes, and snippets.

View stepankuzmin's full-sized avatar
🥡

Stepan Kuzmin stepankuzmin

🥡
View GitHub Profile
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"extends": [
"airbnb",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
@stepankuzmin
stepankuzmin / urbica.zsh-theme
Created August 19, 2019 12:01
Urbica zsh theme
# -*- sh -*- vim:set ft=sh ai et sw=4 sts=4:
# It might be bash like, but I can't have my co-workers knowing I use zsh
PROMPT='%{$fg[green]%}%n@%{$fg[red]%}%m:%{$fg_bold[blue]%}%2~ $(git_prompt_info)%{$reset_color%}%(!.#.$) '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}‹"
ZSH_THEME_GIT_PROMPT_SUFFIX="›%{$reset_color%}"
@stepankuzmin
stepankuzmin / ViewController.swift
Created August 5, 2019 08:41
XCode iOS WebKit WebView
//
// ViewController.swift
// SuperApp-iOS
//
// Created by Stepan Kuzmin on 05/08/2019.
// Copyright © 2019 Stepan Kuzmin. All rights reserved.
//
import UIKit
import WebKit
@stepankuzmin
stepankuzmin / README.md
Created June 27, 2019 17:52
Filter highways from OSM extract
wget http://download.geofabrik.de/russia-latest.osm.pbf
osmconvert russia-latest.osm.pbf -o=russia-latest.o5m
osmfilter russia-latest.o5m --keep="highway=*" > russia-highways.osm
@stepankuzmin
stepankuzmin / test_.py
Created June 26, 2019 15:54
aiohttp + pytest + unittest mock
import aiohttp
from asyncio import Future
from unittest.mock import MagicMock, Mock, patch
def test_taxi_route_info(aiohttp_client, loop):
async def taxi_route_info():
connector = aiohttp.TCPConnector(ssl=False)
session = aiohttp.ClientSession(connector=connector, loop=loop)
taxi_route_info = TaxiRouteInfo(session=session)
@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
@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 / 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
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 / 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://...']
};