Skip to content

Instantly share code, notes, and snippets.

View vinicius73's full-sized avatar
🤓
"Those who cannot acknowledge themselves, will eventually fail."

Vinicius Reis vinicius73

🤓
"Those who cannot acknowledge themselves, will eventually fail."
View GitHub Profile
@vinicius73
vinicius73 / .dockerignore
Created March 22, 2020 22:42
Docker + PM2 - Node Backend APP
node_modules/
dist/
.git/
const pino = require('pino')
const dest = pino.destination()
const logger = pino({
name: process.env.APPLICATION_NAME || 'my-app',
level: process.env.LOG_LEVEL || 'info',
useLevelLabels: true,
base: {
}
}, dest)
const fs = require('fs')
const path = require('path')
const slug = require('slug')
const axios = require('axios')
const progress = require('progress')
const urlRegx = /(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi;
const readList = async () => {
console.info('Loading file data')
@vinicius73
vinicius73 / index.js
Created December 1, 2019 16:54
Script de sorteio inimigo/amigo oculto
const { shuffle, map } = require('lodash')
const { sendMessages } = require('./send-email')
const input = shuffle(require('./input.json'))
function assign (array) {
return map(array, (person, index, array) => {
const friend = array[index + 1] || array[0]
return {
person,
@vinicius73
vinicius73 / Dockerfile
Created October 25, 2019 13:20
jupyter - docker compose
FROM continuumio/anaconda3
RUN /opt/conda/bin/conda install jupyter
RUN mkdir -p /opt/notebooks/notebook
EXPOSE 8888
CMD /opt/conda/bin/jupyter notebook --notebook-dir=/opt/notebooks --ip='*' --port=8888 --no-browser --allow-root
@vinicius73
vinicius73 / Dockerfile
Last active August 15, 2019 22:21
Node project with PM2 and Docker
FROM node:10.15-alpine as base
RUN apk --no-cache --virtual build-dependencies add \
python \
make \
g++ \
&& rm -f /var/cache/apk/* \
&& npm config set unsafe-perm true \
&& npm install --quiet node-gyp -g --cache /tmp/empty-cache
@vinicius73
vinicius73 / main.js
Created February 19, 2019 19:31
Vuex Route Guard DEMO
import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
import plugins from './plugins';
plugins({
router, store, Vue,
});
import { isEmpty } from 'lodash'
import { makeWatch, makeCallback, parseDump } from './utils'
const extractDump = context => {
const dump = context.$route.query.dump
return dump
? parseDump(dump)
: {}
}
import { PromisePipeFactory } from './p-pipe'
import { isFunction, isArray } from 'lodash'
const w = window
/**
* @type Function
* @param {Function}
* @returns {void}
*/
const subscribe = (() => {