Skip to content

Instantly share code, notes, and snippets.

View vinyoliver's full-sized avatar
💻
Working Remotely

Viny Machado vinyoliver

💻
Working Remotely
View GitHub Profile
@vinyoliver
vinyoliver / docker-compose.yml
Created March 30, 2020 14:52
Kafka docker-compose
version: '3'
services:
zookeeper:
image: wurstmeister/zookeeper
ports:
- "2181:2181"
kafka:
image: wurstmeister/kafka
ports:
@vinyoliver
vinyoliver / eslint_prettier_airbnb.md
Created December 13, 2019 22:34 — forked from bradtraversy/eslint_prettier_airbnb.md
ESLint, Prettier & Airbnb Setup

VSCode - ESLint, Prettier & Airbnb Setup

1. Install ESLint & Prettier extensions for VSCode

Optional - Set format on save and any global prettier options

2. Install Packages

npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
@vinyoliver
vinyoliver / AutowiringSpringBeanJobFactory.java
Created April 23, 2019 14:32 — forked from jelies/AutowiringSpringBeanJobFactory.java
Quartz (2.1.6) java config with spring (3.2.1). Using a SpringBeanJobFactory to automatically autowire quartz classes.
package com.jelies.spring3tomcat7.config.quartz;
import org.quartz.spi.TriggerFiredBundle;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.scheduling.quartz.SpringBeanJobFactory;
/**
* This JobFactory autowires automatically the created quartz bean with spring @Autowired dependencies.
@vinyoliver
vinyoliver / git.migrate
Created March 25, 2019 13:24 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@vinyoliver
vinyoliver / .eslintrc
Created February 11, 2019 13:22
Eslint config
{
"parser": "babel-eslint",
"env": {
"browser": true,
"jest": true
},
"plugins": ["react", "jsx-a11y", "import"],
"extends": "airbnb",
"rules": {
"react/jsx-filename-extension": [
@vinyoliver
vinyoliver / flattenArray.js
Created January 7, 2019 20:39
Converts a multiArray into a flatArray - Code sample
function getFlatArray(multiArray){
let flatArray = [];
for(var item of multiArray) {
if(item instanceof Array){
flatArray.push(...getFlatArray(item))
}else {
flatArray.push(item);
}
}
return flatArray;