This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*/ | |
package com.github.superbob.demo.servlets.filter; | |
import java.io.IOException; | |
import javax.servlet.Filter; | |
import javax.servlet.FilterChain; | |
import javax.servlet.FilterConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TimeSpy<Boolean> rsSpy = new TimeSpy<Boolean>() { | |
protected Boolean run() throws Exception { | |
return resultSet.next(); | |
} | |
}; | |
TimeSpy<Boolean> statementSpy = new TimeSpy<Boolean>() { | |
protected Boolean run() throws Exception { | |
return statement.execute(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.util; | |
import java.nio.ByteBuffer; | |
public final class ByteUtil { | |
private ByteUtil() { | |
} | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim:ft=zsh ts=2 sw=2 sts=2 | |
# | |
# A Powerline-inspired theme for ZSH | |
# Mainly base on agnoster's Theme - https://gist.github.com/3712874 | |
# with some slight additions: RPROMPT, segment colored status | |
# to make it look even more like powerline ! | |
# | |
# # README | |
# | |
# In order for this theme to render correctly, you will need a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object BookShop { | |
case class Book(id: Int) | |
val ONE_BOOK_PRICE = 8 | |
val TWO_DISTINCT_BOOKS_WITH_PROMO_PRICE = 15.2 | |
val THREE_DISTINCT_BOOKS_WITH_PROMO_PRICE = 21.6 | |
val FOUR_DISTINCT_BOOKS_WITH_PROMO_PRICE = 25.6 | |
val FIVE_DISTINCT_BOOKS_WITH_PROMO_PRICE = 30 | |
type Basket[T] = List[List[T]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="powerlevel9k/powerlevel9k" | |
DEFAULT_USER="..." | |
export LS_COLORS="di=34;40:ln=36;40:so=35;40:pi=33;40:ex=32;40:bd=1;33;40:cd=1;33;40:su=0;41:sg=0;43:tw=0;42:ow=34;40:" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prompt_nano_git() { | |
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) | |
if [[ $CURRENT_BRANCH == "HEAD" ]]; then | |
COMMIT_ID=$(git rev-parse --short HEAD 2>/dev/null) | |
if [[ -n $COMMIT_ID ]]; then | |
CURRENT_BRANCH="$(git rev-parse --short HEAD 2>/dev/null) (detached)" | |
else | |
CURRENT_BRANCH="master (empty)" | |
fi | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.function.Consumer; | |
import org.assertj.core.matcher.AssertionMatcher; | |
import org.hamcrest.Matcher; | |
import org.mockito.hamcrest.MockitoHamcrest; | |
/** | |
* Allow using AssertJ assertions for mockito matchers. | |
* @see MockitoHamcrest#argThat(Matcher) | |
* @see AssertionMatcher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Insert this at the end of /etc.defaults/ddns_provider.conf | |
[Namecheap] | |
modulepath=/usr/syno/bin/ddns/namecheap.php | |
queryurl=https://dynamicdns.park-your-domain.com/update |