Skip to content

Instantly share code, notes, and snippets.

View GiuseppeMP's full-sized avatar
:bowtie:
https://giuseppematheus.com/

Giuseppe Matheus GiuseppeMP

:bowtie:
https://giuseppematheus.com/
View GitHub Profile
Note: this assumes you are using ZSH shell.
## Installation
Install [asdf](https://github.com/asdf-vm/asdf):
```
$ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.4.0
$ echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.zshrc
$ echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc
@guizordan
guizordan / deploy_glassfish
Last active March 21, 2018 21:06
Glassfish script that starts a domain, stops every other running domain, deploys the latest .ear version and displays logging. Usage: 'bash deploy_glassfish domain-name'
#!/bin/bash
ear_path=~/projeto/FSJ/ambiente/maven_repo/br/com/fsj/retaguarda/fsj-retaguarda-ear/1.0-SNAPSHOT/fsj-retaguarda-ear-1.0-SNAPSHOT.ear
glassfish_path=~/glassfish-3.1.2.2/glassfish
domains_list=$(asadmin list-domains)
project_path=~/projeto/FSJ/branches/18.03.3.0
memory_usage=$(free -m | awk 'NR==2{ printf " %.2f", $3*100/$2 }')
maximum_memory_usage=75.00
function setDatabaseDialect {
@pcan
pcan / SelfExpiringHashMap.java
Last active July 4, 2024 23:51
SelfExpiringHashMap - a Java Map which entries expire automatically after a given time; it uses a DelayQueue internally.
/*
* Copyright (c) 2019 Pierantonio Cangianiello
*
* MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is