Skip to content

Instantly share code, notes, and snippets.

❤️
JavaScript

Vyacheslav tomasevich

❤️
JavaScript
  • Omsk
Block or report user

Report or block tomasevich

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tomasevich
tomasevich / include.md
Created Jan 22, 2020
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 Dec 20, 2019
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 Nov 20, 2019 — 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)

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

@tomasevich
tomasevich / README.md
Last active Sep 2, 2019
Vue + Vuex + Socket
View README.md

Structure

.
├── client
│   ├── package.json (client_package.json)
│   ├── public
│   │   └── index.html (client_public_index.html)
│   ├── src
│   │   ├── components
@tomasevich
tomasevich / mongod.md
Created Aug 14, 2019
mongo problems and resolves
View mongod.md

Attempted to create a lock file on a read-only directory: /data/db, terminating

sudo chmod -R go+w /data/db

@tomasevich
tomasevich / tltd.md
Last active Nov 23, 2019
[TLTD] - Type, Lint, Test & Docs (Best practice of JS development)
View tltd.md

TLTD

Пишите код качественно, безопасно, внятно и красиво!

Томасевич В.С. @ 2019

Практика TLTD (Type, Lint, Test & Docs) - это подход, в котором написание кода на JavaSsript происходит "поэтапно".

Type

@tomasevich
tomasevich / .eslintrc.js
Last active Jun 14, 2019
ESLint config for server-side (no plugins, clear rules)
View .eslintrc.js
'use strict';
const OFF = 0;
const WARN = 1;
const DANGER = 2;
const ALWAYS = 'always';
const NEVER = 'never';
const TAB = 2;
@tomasevich
tomasevich / config.cson
Last active Jun 13, 2019
Atom config file
View config.cson
"*":
"color-picker":
preferredFormat: "HEX"
core:
disabledPackages: [
"hyperclick"
]
telemetryConsent: "no"
docblockr:
auto_add_method_tag: true
View Vues.md

Vues

Mini socket plugin for Vue

./src/Vues.vue

/**
 * Vues
 * (c) 2019 Vyacheslav Tomasevich
You can’t perform that action at this time.