Skip to content

Instantly share code, notes, and snippets.

View dmtpln's full-sized avatar
🏠
Working from home

Dmitry dmtpln

🏠
Working from home
  • Serbia, Belgrade
View GitHub Profile
@dmtpln
dmtpln / autocomplete.tsx
Last active February 14, 2021 12:00
Chakra-ui async autocomplete
import React, { useCallback, useEffect, useState, useRef } from 'react';
import { Box, Input, InputGroup, InputProps, InputRightElement, Spinner } from '@chakra-ui/react';
import styled from '@emotion/styled';
export const Container = styled.div`
position: relative;
`;
interface SuggestionItemProps {
highlighted?: boolean;
@dmtpln
dmtpln / gist:c870f7f25affec4e42f2f6a3dae45d75
Last active March 12, 2020 11:24
Получить расстояние и время между координатами через API яндекс.карты
ymaps.ready(init);
function init() {
ymaps.route([
{ type: 'wayPoint', point: [55.812511, 37.315518] },
{ type: 'wayPoint', point: [55.811511, 37.312518] }
], {
avoidTrafficJams: false
}).then(function (route) {
console.log(route.properties.get('RouterRouteMetaData'));