Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View felipebizz's full-sized avatar
🤔

Felipe Lima felipebizz

🤔
View GitHub Profile
@felipebizz
felipebizz / install_latest_docker_compose.sh
Created March 10, 2017 22:03
Latest Version Docker Compose
#!/bin/bash
# get latest docker compose released tag
COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep 'tag_name' | cut -d\" -f4)
# Install docker-compose
sh -c "curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose"
chmod +x /usr/local/bin/docker-compose
sh -c "curl -L https://raw.githubusercontent.com/docker/compose/${COMPOSE_VERSION}/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose"
@felipebizz
felipebizz / .bashrc
Last active April 13, 2022 17:43
Mostrar branch atual no terminal
#Adicionar no fim do arquivo /home/{user}/.bashrc
#variavel do terminal
export PS1="\[\033[38m\]\u\[\033[32m\] \w \[\033[31m\]\`git \\
branch 2>/dev/null | grep \"^\*\" | \\
sed -r \"s/\*\ (.*)/ \(\1\)/\"\`\[\033[37m\]$\[\033[00m\] "
#Agora, rode o comando source ~/.bashrc para recarregar e ver a alteração sem precisar reiniciar o terminal.
@felipebizz
felipebizz / setVariable.groovy
Created June 26, 2015 22:15
[Mule] Set variable value inside Groovy
<flow name="get:/setVariable:api-config">
<set-variable variableName="username" value="" doc:name="username"/>
<scripting:component doc:name="Groovy">
<scripting:script engine="Groovy">
<![CDATA[
String value = 'felipe'
message.setInvocationProperty('username', value)
]]></scripting:script>
</scripting:component>
@felipebizz
felipebizz / Convert.java
Created June 8, 2016 22:03
Convert Json to Map and Map to Json
package global.visto.tasks.util;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
/**
@felipebizz
felipebizz / terminator_config.bash
Last active May 28, 2016 18:24
Visto System Layout Configuration in terminator
# ~/.config/terminator/config
[global_config]
enabled_plugins = CustomCommandsMenu, ActivityWatch, TerminalShot, LaunchpadCodeURLHandler, APTURLHandler, MavenPluginURLHandler, LaunchpadBugURLHandler
suppress_multiple_term_dialog = True
[keybindings]
switch_to_tab_1 = Insert
[profiles]
[[default]]
scrollback_lines = 900000
package br.com.arizona.visto.system.dam.util;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.*;
/**
* Percorre uma árvore em profundidade.
@felipebizz
felipebizz / hibernate.md
Last active March 21, 2016 14:00
Active hibernate Log
Add property inside of application.properties

spring.jpa.show-sql=true

#####or in file persistence.xml Activate the property for True

@felipebizz
felipebizz / Tree.java
Last active January 19, 2016 13:57
Tree with Ancestors e descendants
package global.visto.core.service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Classe que varre arvore buscando descentes e ascendentes a partir de um nó
* Created by felipe on 19/01/16.
@felipebizz
felipebizz / tree.js
Created January 15, 2016 21:19
Find ancestors and Descendants in a Tree
'use strict';
const findJob = (jobs, id) => {
const found = jobs.filter(job => job.id === id);
return found.length === 0 ? null : found[0];
};
const ancestors = (jobs, id, curr) => {
if (!curr) {
curr = [];
@felipebizz
felipebizz / meld.bash
Last active September 24, 2015 20:26
Configuration Meld on Git
#install the Meld in your terminal
apt-get install meld
#Do Download of file git_mergetool_opt.sh
https://gist.github.com/felipebizz/a7a54b4f6a3e091925f5
#Let this file in ~/
#open your file gitconfig and add this piece of code
[mergetool "git_mergetool_opt"]