Skip to content

Instantly share code, notes, and snippets.

View panser's full-sized avatar

Sergey Panov panser

  • Kiev
View GitHub Profile
public static ClientHttpRequestFactory httpRequestFactoryWithoutSsl() {
TrustStrategy acceptingTrustStrategy = (x509Certificates, s) -> true;
SSLContext sslContext = null;
try {
sslContext = org.apache.http.ssl.SSLContexts.custom().loadTrustMaterial(null, acceptingTrustStrategy).build();
} catch (NoSuchAlgorithmException | KeyManagementException | KeyStoreException e) {
log.error("problem with creating no-ssl context");
}
SSLConnectionSocketFactory csf = new SSLConnectionSocketFactory(sslContext, new NoopHostnameVerifier());
CloseableHttpClient httpClient = HttpClients.custom().setSSLSocketFactory(csf).build();
brew uninstall nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
vim ~/.zshrc
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
nvm install --lts node
nvm ls
nvm alias default 'lts/*'
@panser
panser / jenv
Last active May 18, 2020 18:26
brew update
brew tap homebrew/cask-versions
brew cask install java
brew cask install java11
brew cask install java8
brew install jenv
vim ~/.zshrc
export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"
https://github.com/lettuce-io/lettuce-core/issues/882#issuecomment-430531861
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<suppress files="[\\/]jaxb[\\/]" checks=".*"/>
<!-- (6.9.1 version of checkstyle) suppress files="^(?!.*[\\/]jaxb[\\/])([a-zA-Z0-9\\/]*)" checks=".*"/-->
</suppressions>
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration that checks the sun coding conventions from:
- the Java Language Specification at
/*! ******************************
Handlebars helpers
*******************************/
// debug helper
// usage: {{debug}} or {{debug someValue}}
// from: @commondream (http://thinkvitamin.com/code/handlebars-js-part-3-tips-and-tricks/)
Handlebars.registerHelper("debug", function(optionalValue) {
console.log("Current Context");
console.log("====================");
@panser
panser / blogspot_002.01
Created February 23, 2015 17:38
Multiline search in Eclipse
(?s)word1.*word2
Spring profiles https://github.com/exogenesick/jersey-rest/blob/614eebd3981ca0bfffa7f32da78958623fcd8167/src/main/resources/application-context.xml
@panser
panser / Solution.java
Created November 24, 2013 08:53
level03.lesson06.task03
package com.javarush.test.level03.lesson06.task03;
/* Семь цветов радуги
Выведи на экран текст: семь цветов радуги.
В каждой строке должно быть по три цвета, в последней - один.
Цвета разделяй пробелом.
*/
public class Solution
{