- Open Terminal App; enter this command
sudo nano /etc/hosts- Drop fllowing line into the end of the file and save it
0.0.0.0 ocsp.apple.comsudo nano /etc/hosts0.0.0.0 ocsp.apple.com| { | |
| "610433": "mellat", | |
| "589905": "melli", | |
| "170019": "melli", | |
| "603799": "melli", | |
| "603769": "saderat", | |
| "639217": "keshavarzi", | |
| "603770": "keshavarzi", | |
| "589210": "sepah", | |
| "627353": "tejarat", |
| // app-style.js | |
| // adding <style></style> directly inside template will result in error or empty element which | |
| // this component is trying to address | |
| // this will allow you to dynamically insert css inside Vue template without the use of vue loader | |
| // or if you do not want to use .vue extension at all | |
| // however it doesnt really apply scope css (for now). | |
| export default { | |
| name: 'app-style', | |
| data: function(){ | |
| return { |
| /** | |
| * we are going to upload file to s3 via node js by using | |
| * aws-sdk - required | |
| * busboy - required | |
| * uuid - optional - for image renaming purpose | |
| * with this library you can upload any kind of file to s3 via node js. | |
| */ | |
| const AWS = require('aws-sdk'); | |
| const UUID = require('uuid/v4'); |
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 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:
| /** | |
| * Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken | |
| * It was requested to be introduced at as part of the jsonwebtoken library, | |
| * since we feel it does not add too much value but it will add code to mantain | |
| * we won't include it. | |
| * | |
| * I create this gist just to help those who want to auto-refresh JWTs. | |
| */ | |
| const jwt = require('jsonwebtoken'); |
| const file = this.input.files[0]; | |
| //console.log(file); | |
| var xhr = new XMLHttpRequest(); | |
| xhr.addEventListener('load', (e) => { | |
| console.log(e.target.response); | |
| }); | |
| xhr.open('POST', host + 'fileuploadstream', true); | |
| xhr.setRequestHeader('body', JSON.stringify({ id: 'somebucketfolderid', fn: file.name })); | |
| xhr.send(file); |
Thanks to the following resources:
| .mt-0 { | |
| margin-top: 0px !important; | |
| } | |
| .mt-5 { | |
| margin-top: 5px !important; | |
| } | |
| .mt-10 { | |
| margin-top: 10px !important; | |
| } | |
| .mt-15 { |
| /** | |
| * @file A WordPress-like hook system for JavaScript. | |
| * | |
| * This file demonstrates a simple hook system for JavaScript based on the hook | |
| * system in WordPress. The purpose of this is to make your code extensible and | |
| * allowing other developers to hook into your code with their own callbacks. | |
| * | |
| * There are other ways to do this, but this will feel right at home for | |
| * WordPress developers. | |
| * |