Skip to content

Instantly share code, notes, and snippets.

View tomasevich's full-sized avatar
❤️
TypeScript / JavaScript

Vyacheslav tomasevich

❤️
TypeScript / JavaScript
  • Russia, Krasnodar
View GitHub Profile
View README.md

Как установить счетчики Yandex.Metrik и Google Analytics в NextJS

Для тех, кто только начинает разбираться в NextJS и не понял как это работает, я приложил решение

Как установить

  1. Берем компонент Analytics и ложим в папку ~/components/analytics.js
  2. Подключаем в обертке ~/pages/_app.js в тело страницы (ВАЖНО, не в <Head></Head>)
  3. Проверяем работу
@tomasevich
tomasevich / known_hosts.md
Created November 29, 2021 13:28
Host key verification failed
View known_hosts.md

fatal: Could not read from remote repository? Please make sure you have the correct access rights and the repository exists?

Try this: ssh-keyscan -H github.com > ~/.ssh/known_hosts

View README.md

Остановка и запуск MySQL & MongoDB & Docker на Windows

Запускать из под администратора

mongo - https://stackoverflow.com/a/47676675

# Запуск
net start MongoDB
@tomasevich
tomasevich / README.md
Last active September 29, 2021 13:01
.vscode
View README.md
@tomasevich
tomasevich / .dockerignore
Last active January 10, 2023 08:53
VueJS + ExpressJS + Nginx + MongoDB
View .dockerignore
# DOCKER
.dockerignore
Dockerfile
docker-compose.yml
# OS
.DS_Store
# NPM
backend/node_modules
@tomasevich
tomasevich / leaflet.md
Created March 3, 2020 08:03
Remove/delete all markers from map (leaflet)
View leaflet.md

I use markercluster

var markers = L.markerClusterGroup()

/* delete method */
map.eachLayer(function(layer) {
    if (layer instanceof L.MarkerClusterGroup)
    {
 map.removeLayer(layer)
@tomasevich
tomasevich / include.md
Created January 22, 2020 08:58
Better local require() paths for Node.js
View include.md

Config

Add this global function to main entrypoint like index.js

global.include = prevPath => {
  const newPath = prevPath.replace('@', __dirname + '/')
  console.log(prevPath, '=>', newPath)

 return require(newPath)
@tomasevich
tomasevich / .editorconfig
Created December 20, 2019 05:21
Editor config (for all files
View .editorconfig
root = true
charset = utf-8
[*]
tab_width = 4
indent_style = tab
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
View vue_express_serve_static.md

VueJS + ExpressJS

Serve static files, exclude 404 error on backend

Make middleware

/* serve.js */
const path = require("path");
const express = require("express");
@tomasevich
tomasevich / remove-all-from-docker.md
Last active February 23, 2024 19:40 — forked from beeman/remove-all-from-docker.sh
Удалить/очистить все данные Докера (контейнеры, образы, тома и сети)
View remove-all-from-docker.md

Удалить/очистить все данные Докера (контейнеры, образы, тома и сети)

Одной строкой

docker stop $(docker ps -qa) && docker rm $(docker ps -qa) && docker rmi -f $(docker images -qa) && docker volume rm $(docker volume ls -q) && docker network rm $(docker network ls -q)

Описание команд