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
from rx import Observable, Observer | |
letters = Observable.from_(['Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon']) | |
letters.subscribe(on_next=lambda s: print(s), | |
on_completed=lambda: print('Done'), | |
on_error=lambda e: print(e)) |
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.context.annotation.Configuration; | |
import org.springframework.http.converter.HttpMessageConverter; | |
import org.springframework.http.converter.json.GsonHttpMessageConverter; | |
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; | |
import java.util.List; | |
@Configuration | |
public class AppWebMvcConfiguration extends WebMvcConfigurerAdapter { |
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
Go to private repository in browser (e.g. https://<PRIVATE_REG>:5000/v2/_catalog) | |
Download the certificate (e.g. View Cerificate > Details > Export (PEM format)) | |
Copy crt certificate to: /usr/local/share/ca-certificates/ | |
sudo update-ca-certificates --verbose | |
systemctl restart docker | |
Confirm it all works by trying to pull down a docker image from the private registry: |
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') { |
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
<!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
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
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
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; |