View logback-log-hibernate-params.xml
<logger name="org.hibernate.type" level="TRACE"/>
View MockFinalClass.java
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
@RunWith(PowerMockRunner.class)
@PrepareForTest(MyFinalClass.class)
public class MyFinalClassTest {
View ZonedDateTimeAsUTC.java
/*
*
* Methods manipulate milliseconds field (fastTime) in java.util.Date object.
*
* UTC : 12/10/2017 11:15:00
* Local date time : 12/10/2017 14:15:00 +03:00
*
* @return new java.util.Date
* UTC : 12/10/2017 14:15:00
* Local date time : 12/10/2017 17:15:00 +03:00
View IsJVMOnDebugMode.java
/**
*
* -----------------------------------------------------------------------------------
* From : org.junit.rules.DisableOnDebug#isDebugging(java.util.List<java.lang.String>)
* -----------------------------------------------------------------------------------
*
* Parses arguments passed to the runtime environment for debug flags
* <p>
* Options specified in:
* <ul>
View MockitoOtherwiseCaseStubbing.java
// Cover all `otherwise` cases first
doThrow(new IllegalArgumentException()).when(mockMessageSource).getMessage(any(String.class), any(Locale.class));
// after that specify requested legal case
doReturn("Merhaba Hayye").when(mockMessageSource).getMessage("hello.message.key", new Locale("tr"));
View iterm2-shell-integration-tools.txt
imgcat filename
Displays the image inline.
imgls
Shows a directory listing with image thumbnails
it2attention start|stop|fireworks
Gets your attention
it2check
Checks if the terminal is iTerm2
it2copy [filename]
Copies to the pasteboard
View xmp-installation.sh
# libxmp installed via brew
libxmp_LIBS=-L/usr/local/Cellar/libxmp/4.4.1/lib \
libxmp_CFLAGS=-I/usr/local/Cellar/libxmp/4.4.1/include \
./configure
sudo make install
View append-multiline-to-file.sh
cat << EOF >> ~/.zshrc
export PATH="$PATH:/my/fancy/app/path"
alias helehele="echo 'hele hele antepli'"
EOF
View git-remove-branch.sh
git push origin --delete BRANCH_NAME
git branch -D BRANCH_NAME