This file contains hidden or 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.BiFunction; | |
import java.util.function.Function; | |
import static Pet.*; | |
public class BiFunctionValidationExample { | |
public static void main(String[] args) { | |
// BiFunction example | |
BiFunctionValidation<Pet, String> v = new BiFunctionValidation<>(IS_EMPTY_RETURN_PET); |
This file contains hidden or 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
node { | |
stage('GetUserCredential') { | |
// Requires Credential setup (MyCredentialID) | |
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'MyCredentialID', | |
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) { | |
sh ''' | |
set +x | |
echo "$USERNAME" > output.txt | |
''' |
This file contains hidden or 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 org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.web.servlet.HandlerMapping; | |
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import java.util.Map; | |
import static java.lang.String.format; |
This file contains hidden or 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
public class BaseTest { | |
final Logger logger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); | |
@Mock | |
protected Appender mockAppender; | |
@Captor | |
protected ArgumentCaptor<LoggingEvent> captorLoggingEvent; | |
@Before |
This file contains hidden or 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
apply plugin: 'groovy' | |
apply plugin: 'idea' | |
repositories { | |
jcenter() | |
} | |
idea { | |
project { | |
ipr { |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="keywords" content="design patterns"> | |
<title>Mastering Javascript</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script> |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="keywords" content="design patterns"> | |
<title>Mastering Javascript</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script> |
This file contains hidden or 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
(function(win, $) { | |
var CircleGeneratorSingleton = (function() { | |
var instance; | |
function init() { | |
var _aCircle = [], | |
_stage = $('.advert'); | |
function _position(circle, left, top) { |
This file contains hidden or 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
(function(win, $) { | |
var RedCircle = function() { | |
this.item = $('<div class="circle"></div>'); | |
}, | |
BlueCircle = function() { | |
this.item = $('<div class="circle" style="background:blue"></div>'); | |
}, | |
CircleFactory = function(color) { | |
this.create = function(color) { | |
if (color === 'blue') { |