Skip to content

Instantly share code, notes, and snippets.

View VitaliyRDev's full-sized avatar
🎯
Focusing

Vitaliy Rad VitaliyRDev

🎯
Focusing
  • Ukraine
View GitHub Profile
@VitaliyRDev
VitaliyRDev / A Nuxt.js VPS production deployment.md
Created February 4, 2019 15:39 — forked from DreaMinder/A Nuxt.js VPS production deployment.md
Deployment manual for a real-world project built with nuxt.js + koa + nginx + pm2

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 DigitalOcean.com or Vultr.com. It's easier to use things like Now for deployment but for most cases VPS gives more flexebillity needed for projects bigger then 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:

@VitaliyRDev
VitaliyRDev / deepClone.js
Created November 29, 2018 21:45 — forked from cassaram09/deepClone.js
JavaScript deep clone function
function deepClone(source){
// If the source isn't an Object or Array, throw an error.
if ( !(source instanceof Object) || source instanceof Date || source instanceof String) {
throw 'Only Objects or Arrays are supported.'
}
// Set the target data type before copying.
var target = source instanceof Array ? [] : {};
for (let prop in source){