Skip to content

Instantly share code, notes, and snippets.

View jurigis's full-sized avatar

Jürgen Kraus jurigis

View GitHub Profile
@jurigis
jurigis / HashTagBuilder.java
Last active April 29, 2016 18:28
Adding hash tag charactor to a string (adding #)
import java.util.List;
/**
* Adds the # character to all words of the text.
*
* @author https://github.com/jurigis
*/
public class HashTagBuilder {
public static String addHashTags(final String textToTag, final List<String> wordList) {
@jurigis
jurigis / RestProxyTemplate.java
Last active December 2, 2022 16:05 — forked from davidtimmerman/RestProxyTemplate.java
Spring RestTemplate with proxy settings and proxy authentication
import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.ProxyAuthenticationStrategy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@jurigis
jurigis / oc-bootstrap-ajax-validation-errors.js
Last active December 31, 2015 14:06
OctoberCms. Shows ajax validation errors in Backend.
(function(){
function showFieldsValidationMessages(jqXHR, $target) {
if (!$target) {
$target = $('form').first();
}
if (jqXHR.hasOwnProperty('responseJSON')) {
if (jqXHR.responseJSON['X_OCTOBER_ERROR_FIELDS']) {
$("span.error").text("");