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
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
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
from rx import Observable, Observer | |
letters = Observable.from_(['Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon']) \ | |
.map(lambda s: len(s)) \ | |
.filter(lambda i: i >= 5) \ | |
.subscribe(lambda i: print(i)) |
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 | |
Observable.interval(1000) \ | |
.map(lambda i: "{0} Mississippi".format(i))\ | |
.subscribe(lambda s: print(s)) | |
input("Press any key to quit") |
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.List; | |
import java.util.Random; | |
import java.util.function.Supplier; | |
import java.util.stream.Collectors; | |
import java.util.stream.Stream; | |
class TestRandomStringGenerator { | |
private static Supplier<String> randomDischargeId = () -> RandomStringUtils.randomConsonant(8); | |
public static void main(String[] args) { |
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.Arrays; | |
import java.util.Random; | |
import java.util.function.Predicate; | |
public class BubbleSort { | |
private static Random random = new Random(); | |
private Integer[] sort(Integer[] array, Predicate<Integer> sortType) { | |
int count = 0; |
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.prototype.method = function (name, func) { | |
this.prototype[name] = func; | |
return this; | |
}; | |
Number.method('integer', function ( ) { | |
return Math[this < 0 ? 'ceil' : 'floor'](this); | |
}); | |
document.writeln((-10 / 3).integer( )); // −3 |
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.prototype.method = function (name, func) { | |
this.prototype[name] = func; | |
return this; | |
}; | |
String.method('trim', function ( ) { | |
return this.replace(/^\s+|\s+$/g, ''); | |
}); | |
document.writeln('"' + " neat ".trim( ) + '"'); |
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.hibernate.validator.constraints.NotEmpty; | |
import org.junit.BeforeClass; | |
import org.junit.Test; | |
import javax.validation.ConstraintViolation; | |
import javax.validation.Validation; | |
import javax.validation.Validator; | |
import javax.validation.ValidatorFactory; | |
import java.util.Set; |