Skip to content

Instantly share code, notes, and snippets.

View fabiojb's full-sized avatar

Fabio José Bohnenberger fabiojb

  • Brazil
View GitHub Profile
@fabiojb
fabiojb / Identifiable.java
Last active July 11, 2016 23:50
JSF Generic converter for Entities, Enums, etc.
package org.teste.model;
public interface Identifiable<T> {
public T getId();
}
@fabiojb
fabiojb / ChromeModHeaders.java
Created September 15, 2017 16:51
Chrome Driver with ModHeaders extension in Java
String userHome = System.getProperty("user.home");
options.addExtensions(new File(userHome + "\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Extensions\\idgpnmonknjnojddfkpgkljpfnnfcklj\\2.1.2_0.crx"));
// Enable LocalStorage
driver.navigate().to("chrome-extension://idgpnmonknjnojddfkpgkljpfnnfcklj/icon.png");
((JavascriptExecutor)driver).executeScript(
"localStorage.setItem('profiles', JSON.stringify([{" +
" title: 'Selenium', hideComment: true, appendMode: ''," +
" headers: [" +
#! /bin/sh -
# idiomatic parameter and option handling in sh
while test $# -gt 0
do
case "$1" in
--opt1) echo "option 1"
;;
--opt2) echo "option 2"
;;
@Configuration
@ConditionalOnClass(ObjectMapper.class)
public class SquigglyAutoconfigure {
@Bean
public FilterRegistrationBean squigglyRequestFilter(ObjectMapper objectMapper) {
Squiggly.init(objectMapper, new RequestSquigglyContextProvider());
FilterRegistrationBean<SquigglyRequestFilter> filter = new FilterRegistrationBean<>();
@fabiojb
fabiojb / install-development-environment-win.bat
Last active November 13, 2021 17:09
Instalação do ambiente Windows para desenvolvimento back-end Java, com as principais ferramentas necessárias e alguns adicionais
:: chocolatey install
powershell -c "Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
:: scoop install
powershell -c "Set-ExecutionPolicy RemoteSigned -scope CurrentUser; iex (new-object net.webclient).downloadstring('https://get.scoop.sh')"
choco feature enable -n allowGlobalConfirmation
:: essentials
choco install openjdk
@fabiojb
fabiojb / lightshot.json
Created October 24, 2018 12:27
Lightshot scoop app manifest
{
"homepage": "https://prnt.sc",
"license": {
"identifier": "Freeware",
"url": "https://app.prntscr.com/en/license.html"
},
"url": "https://app.prntscr.com/build/setup-lightshot.exe",
"hash": "455b17124a474bfa512580ba9bcd275dc8e1119482ad604b83b3cb5611a6f73f",
"version": "5.4.0.35",
"extract_dir": "lightshot",
#!/bin/bash
function mvn() {
if [ "$1" = "i" ]; then
command mvn install
else
command mvn $@
fi
}
scoop install git
scoop bucket add java
scoop bucket add extras
:: essentials
scoop install 7zip \
openjdk11 \
maven \
vscode \