Skip to content

Instantly share code, notes, and snippets.


Alexey Kleandrov akleandrov

  • Russia,Saint-Petersburg
View GitHub Profile
DreaMinder / A Nuxt.js VPS production
Last active Aug 25, 2022
Deployment manual for a real-world project built with nuxt.js + koa + nginx + pm2
View A Nuxt.js VPS production

Example of deployment process which I use in my Nuxt.js projects. I usually have 3 components running per project: admin-panel SPA, nuxt.js renderer and JSON API.

This manual is relevant for VPS such as or It's easier to use things like Now for deployment but for most cases VPS gives more flexebillity needed for projects bigger than a landing page.

UPD: This manual now compatible with nuxt@2.3. For older versions deployment, see revision history.

Let's assume that you have entered fresh installation of Ubuntu instance via SSH. Let's rock:

sameoldmadness /
Last active Mar 24, 2022
Нагрузочное тестирование c Yandex.Tank и JMeter

Нагрузочное тестирование c Yandex.Tank и JMeter

На этой странице описывается процесс настройки нагрузочного тестирования внешних ресурсов.


Для тестирования поведения сервиса под нагрузкой используется утилита Yandex Tank.

Танку можно указать патроны (HTTP-запросы, которые будут отправлены на целевой сервер) и расписание (количество запросов в секунду к целевому серверу в каждый момент времени стрельб, а также продолжительность стрельб). Также к танку можно подключить плагин мониторинга, позволяющий снимать показатели (например, количество свободной памяти или загрузку процессора) с целевого сервера.

zmts /
Last active Sep 27, 2022
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
SalahAdDin /
Last active May 29, 2022
Instlling React-Native Android Environment in ArchLinux

First step: Install Android SDK

  1. yaourt -S android-sdk android-sdk-platform-tools android-sdk-build-tools
    Note: Maybe you'll have problems with the lasta package: ncurses5-compat-libs. In order to avoid this problem you have to use this command: gpg --recv-keys F7E48EDB. You can find clarification here.
  2. yaourt -S genymotion
    Note: You'll need install virtual-box and his modules, yaourt will make for you but you need choos between ArchLinux host modules or DKMS host modules.
  3. Enter in super user mode with su - and then do echo -e "vboxdrv\nvboxnetflt\nvboxnetadp\nvboxpci" > /etc/modules-load.d/virtualbox.conf
    Note: You need do this with super user because need super user permissions and with sudo, for us at least, doesn't work.
  4. sudo modprobe vboxdrv vboxnetadp vboxnetflt
    Activate for current session.
  5. sudo chmod -R 777 /opt/android-sdk
DarrenN / get-npm-package-version
Last active Sep 15, 2022 — forked from yvele/get-npm-package-version
Extract version from package.json (NPM) using bash / shell
View get-npm-package-version
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
mbbx6spp / ALTERNATIVES.adoc
Last active Sep 4, 2022
Super quick list of alternatives to Jira and/or Confluence, Stash, Crucible, etc.
View 1-restify-server-cheatsheet.js
// Restify Server CheatSheet.
// More about the API:
// Install restify with npm install restify
// 1.1. Creating a Server.
var restify = require('restify');
thoop / nginx.conf
Last active Jul 31, 2022
Official nginx.conf for nginx
View nginx.conf
# Change YOUR_TOKEN to your prerender token
# Change (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
root /path/to/your/root;
index index.html;
branneman /
Last active Sep 20, 2022
Better local require() paths for Node.js

Better local require() paths for Node.js


When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

facultymatt /
Last active Sep 29, 2022
Roles and permissions system for Nodejs