Skip to content

Instantly share code, notes, and snippets.

View felipebizz's full-sized avatar
🤔

Felipe Lima felipebizz

🤔
View GitHub Profile
@felipebizz
felipebizz / gitconfig.example.ini
Last active August 29, 2015 14:12
~/.gitconfig
[user]
name = Felipe Lima
email = [email protected]
[core]
excludesfile = ~/.gitignore_global
editor = /usr/bin/vim
# Mergetool for mac os env
# [mergetool "sourcetree"]
@felipebizz
felipebizz / Intellij launcher.ini
Last active August 29, 2015 14:13
Create a Intellij launcher in desktop Ubuntu
// create file:
sudo vim /usr/share/applications/intellij.desktop
// add the following
[Desktop Entry]
Version=13.0
Type=Application
Terminal=false
Icon[en_US]=/opt/idea/bin/idea.png
Name[en_US]=IntelliJ
@felipebizz
felipebizz / git_commands.ini
Last active August 29, 2015 14:14
Git Examples
#Configurando informações sobre o autor dos commits:
git config --global user.name "Felipe Lima"
git config --global user.email "[email protected]"
É possível alterar essas informações no arquivo ~/.gitconfig
#Criando um repositório local:
cd meuprojeto
git init
@felipebizz
felipebizz / form.js
Last active August 29, 2015 14:15
Envio de List Form Jquery para métotdo no Spring MVC
var $form = $('<form method="post" action="'+baseUrl+'/dam/asset/multi-selection/metadata/multi/edit">');
//Aqui meus ids estavam armazenados no localStorage, ai só iterei e concatenei nos inputs
for (var i in window.localStorage) {
if (i.indexOf('_v-') === -1) {
continue;
}
businessFiles[index] = i.replace('_v-', '');
$form.append('<input type="hidden" name = "ids" value="'+businessFiles[index] +'"/>');
}
@felipebizz
felipebizz / LoadForm.java
Created February 13, 2015 13:01
Meodo de Classe Java que recebe uma lista de ids no Controller, vindo de um form JQuery
/**
* Exemplo que recebe uma lista de ids no Controller, vindo de um form JQuery
*
* @param ids businessFiles
* @return modelAndView
* @throws BusinessFileAccessDeniedException
*/
@RequestMapping(method = RequestMethod.POST, value = MultiAssetsSelectionView.METADATA_EDIT_ROUTE)
@RolesAllowed({"visto.dam.asset.multiselection.multi.edition.edit"})
public ModelAndView loadForm(@Valid final @RequestParam("ids") List<String> ids)
@felipebizz
felipebizz / UpdateHashMap.java
Last active August 29, 2015 14:15
Atualizando valor de um HashMap
public class UpdateHashMap {
public static void main(String [] args) {
Map<String, String[]> formParameters = new HashMap<>();
String[] a = new String[1];
a[0] = "done";
String[] b = new String[1];
b[0] = "lua_çêéóú.JPG";
@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 / show_binary_image.html
Created March 20, 2015 19:37
How to show binary image in HTML
<img src="data:image/*;base64,
/9j/4AAQSkZJRgABAQAAAQABAAD//gA8Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcg
SlBFRyB2NjIpLCBxdWFsaXR5ID0gMTAwCv/bAEMAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB
AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/bAEMBAQEBAQEBAQEBAQEBAQEB
AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIALIA
sgMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQD
BQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygp
KjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJma
oqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/
xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQID
@felipebizz
felipebizz / erase_kernel
Created April 7, 2015 21:58
Erase Kernel Old Versions
##############################################################
#### Apagar versoes antigas de Kernel ####
##############################################################
#ver versoes anteriores do linux instaladas
dpkg --get-selections | grep linux-image
#APAGAR(Sempre deixar duas)
@felipebizz
felipebizz / utils_ubuntu.sh
Last active August 29, 2015 14:18
Utils Ubuntu
#SYSTEM LOAD INDICATOR
sudo add-apt-repository ppa:indicator-multiload/stable-daily
sudo apt-get update
sudo apt-get install indicator-multiload
#Dentro do arquivo /home/felipe/.bashrc
#variavel do terminal
export PS1="\[\033[38m\]\u\[\033[32m\] \w \[\033[31m\]\`git \\
branch 2>/dev/null | grep \"^\*\" | \\