In your command-line run the following commands:
brew doctor
brew update
[{"name":"Andorra","countryCode":"AD","countryCodeAlpha3":"AND","phone":"376","currency":"EUR","flag":"","symbol":"€","stateProvinces":[{"name":"Sant Julià de Loria"},{"name":"Ordino"},{"name":"La Massana"},{"name":"Encamp"},{"name":"Canillo"},{"name":"Andorra la Vella"},{"name":"Escaldes-Engordany"}]},{"name":"United Arab Emirates","countryCode":"AE","countryCodeAlpha3":"ARE","phone":"971","currency":"AED","flag":"","symbol":"DH","stateProvinces":[{"name":"Imārat Umm al Qaywayn"},{"name":"Raʼs al Khaymah"},{"name":"Dubai"},{"name":"Sharjah"},{"name":"Fujairah"},{"name":"Ajman"},{"name":"Abu Dhabi"}]},{"name":"Afghanistan","countryCode":"AF","countryCodeAlpha3":"AFG","phone":"93","currency":"AFN","flag":"","symbol":"؋","stateProvinces":[{"name":"Zabul"},{"name":"Maidan Wardak Province"},{"name":"Takhar"},{"name":"Sar-e Pol Province"},{"name":"Samangan"},{"name":"Parwan"},{"name":"Paktika"},{"name":"Paktia"},{"name":"Oruzgan"},{"name":"Nimroz"},{"name":"Nangarhar"},{"name":"Logar"},{"name":"Laghman"},{"name":" |
In your command-line run the following commands:
brew doctor
brew update
const choices = ["rock", "paper", "scissors"]; | |
function computerPlay(choices) { | |
let option = choices[Math.floor(Math.random() * choices.length)]; | |
return option; | |
} | |
const possibleResults = { | |
rock_rock: { action: "tie", message: "It's a tie! rock holds rock" }, | |
rock_paper: { action: "lose", message: "You lose! paper covers rock" }, |
/** | |
* Return a formated string from a date Object mimicking PHP's date() functionality | |
* | |
* @param {string} format "Y-m-d H:i:s" or similar PHP-style date format string | |
* @param {* | null} date Date Object, Datestring, or milliseconds | |
* | |
*/ | |
function date(format, date) { | |
if (!date || date === "") { | |
date = new Date(); |
MerryKurta
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user
Based off of: http://docs.sequelizejs.com/en/1.7.0/articles/express/
Create and initialize your a directory for your Express application.
$ mkdir sequelize-demo
const passport = require('passport'); | |
const Strategy = require('passport-facebook').Strategy; | |
require('dotenv').config(); | |
// Configure Passport authenticated session persistence. | |
passport.serializeUser(function(user, cb) { | |
cb(null, user); | |
}); | |
passport.deserializeUser(function(obj, cb) { |
[{"state":{"name":"Abia State","id":1,"locals":[{"name":"Aba South","id":1},{"name":"Arochukwu","id":2},{"name":"Bende","id":3},{"name":"Ikwuano","id":4},{"name":"Isiala Ngwa North","id":5},{"name":"Isiala Ngwa South","id":6},{"name":"Isuikwuato","id":7},{"name":"Obi Ngwa","id":8},{"name":"Ohafia","id":9},{"name":"Osisioma","id":10},{"name":"Ugwunagbo","id":11},{"name":"Ukwa East","id":12},{"name":"Ukwa West","id":13},{"name":"Umuahia North","id":14},{"name":"Umuahia South","id":15},{"name":"Umu Nneochi","id":16}]}},{"state":{"name":"Adamawa State","id":2,"locals":[{"name":"Fufure","id":1},{"name":"Ganye","id":2},{"name":"Gayuk","id":3},{"name":"Gombi","id":4},{"name":"Grie","id":5},{"name":"Hong","id":6},{"name":"Jada","id":7},{"name":"Lamurde","id":8},{"name":"Madagali","id":9},{"name":"Maiha","id":10},{"name":"Mayo Belwa","id":11},{"name":"Michika","id":12},{"name":"Mubi North","id":13},{"name":"Mubi South","id":14},{"name":"Numan","id":15},{"name":"Shelleng","id":16},{"name":"Song","id":17},{"name":"Toung |