View sequelize-models-index.js
'use strict'
const fs = require('fs')
const path = require('path')
const Sequelize = require('sequelize')
const basename = path.basename(module.filename)
const config = require(__dirname + '/../config')
const env = config.NODE_ENV
const envConfig = config[env] // environment specific configs
const _ = require('lodash')

Executar React Native com emulador Genymotion

O React Native é um framework Node.js que permite a geração de apps nativos constrolados pelo motor de JavaScript do Android e iOS.

É o projeto por trás dos apps do Facebook, Instagram, AirBnB, Wallmart, Skype e [outros][react-native-showcase].

  • [instalar Android Studio + Android SDK][install-android-studio]
  • garantir que é possível executar ADB do terminal (ADB incluso na variável de ambiente PATH)
  • [instalar Virtual Box][install-virtual-box] (para Genymotion)
  • [instalar Genymotion][install-genymotion]

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. 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
View mapStatesTwoWay.vuex.js
import { mapState } from 'vuex'
export default function mapStatesTwoWay (namespace, states, updateCb) {
const mappedStates = mapState(namespace, states)
const res = {}
for (const key in mappedStates) {
res[key] = {
set (value) {, { [key]: value })
View destructuring.js
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];

Deverus Vue.js Style Guide

Guide for developing Vue.js applications.

v. 0.0.1

Vue.js is an amazing framework, which can be as powerful as Angular or React, the two big heavy hitters in the world of front-end frameworks.

However, most of Vue's ease-of-use is due to the use of Observables - a pattern that triggers re-renders and other function calls with the reassignment of a variable.

View nginx.conf
# CORS header support
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
# include cors_support;
# As of Nginx 1.7.5, add_header supports an "always" parameter which
View restify-joi-validation.js
const {BadRequestError} = require('restify/lib/errors');
const Joi = require('joi');
module.exports = function validationPlugin() {
const fields = ['params', 'query', 'body'];
return function validationMiddleware(req, res, next) {
if (!req.route || !req.route.validate) {
return next();