Skip to content

Instantly share code, notes, and snippets.

Working from the wormhole

Dmitry Smirnov dmitry-smirnov

Working from the wormhole
View GitHub Profile
View bd09towgs84.js
import coordtransform from "coordtransform";
mapboxgl.accessToken = '<your mapbox access token>';
let exampleMap;
const bd09Coords = [113.341334, 23.193119];
function renderMap() {
View flatten.js
function flatten(inputArray) {
* One can argue that it's a good idea to validate inputArray
* value here, but i disagree. In this exact case it's better
* to not reinvent the wheel — if inputArray is not an Array
* application will throw error anyway at .reduce step
return inputArray.reduce((accumulator, current) => {
View venv.txt
# Install python version using pyenv
pyenv install 3.7.0
# Install environment at your project
1. cd myproject
2. virtualenv -p /home/ubuntu/.pyenv/versions/3.7.0/bin/python pythonenv
# Each time you work with the project
1. cd myproject
2. . pythonenv/bin/active
View locale.js
function getLocale() {
return (navigator.userLanguage || navigator.language || navigator.systemLanguage).toLowerCase();
View loadScript.js
function loadScript(src, fn) {
var script, done, head;
script = document.createElement('script');
script.src = src;
script.async = true;
script.onload = script.onreadystatechange = function() {
if (!done && (!this.readyState || this.readyState === 'loaded' || this.readyState === 'complete')) {
done = true;
dmitry-smirnov / example.html
Last active Aug 29, 2015 Social Sharing Widget AngularJS integration
View example.html
<!doctype html>
<html lang="en" data-framework="angularjs">
<meta charset="utf-8">
<title>AngularJS widget integration</title>
window.pwidget_config = {}; // post widget config (optional)
You can’t perform that action at this time.