Skip to content

Instantly share code, notes, and snippets.

View jurigis's full-sized avatar

Jürgen Kraus jurigis

View GitHub Profile
@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("");
@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;