Skip to content

Instantly share code, notes, and snippets.

View slezicz's full-sized avatar

Antonin Slezacek slezicz

  • Pilsen, Czech Republic
View GitHub Profile
@slezicz
slezicz / RestClientSelfSIgnedCertificate.java
Last active December 9, 2021 07:08
Rest Template SSL trust self signed certificate
final HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory();
SSLContextBuilder builder = new SSLContextBuilder();
builder.loadTrustMaterial(null, new TrustSelfSignedStrategy());
SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(builder.build());
CloseableHttpClient httpclient = HttpClients.custom().setSSLSocketFactory(sslsf).build();
requestFactory.setHttpClient(httpclient);
RestTemplate template = new RestTemplate(requestFactory);
@slezicz
slezicz / add_day_date
Created January 29, 2016 14:59
Add DAY to date
String dt = "2008-01-01"; // Start date
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
c.setTime(sdf.parse(dt));
c.add(Calendar.DATE, 1); // number of days to add
dt = sdf.format(c.getTime()); // dt is now the new date
body {
background: #fff;
color: #333;
font-size: 11px;
height: auto;
padding-top:60px;
}
.container_16{
width: 960px;