Skip to content

Instantly share code, notes, and snippets.

function FindProxyForURL(url, host) {
proxy = "SOCKS5 192.168.200.48:4128; SOCKS4 192.168.200.48:4128"
if (dnsDomainIs(host, ".ardanlabs.com.")
|| dnsDomainIs(host, ".ardanlabs.com")
|| dnsDomainIs(host, "ardanlabs.com")
|| dnsDomainIs(host, ".ardmediathek.de.")
|| dnsDomainIs(host, ".ardmediathek.de")
|| dnsDomainIs(host, "ardmediathek.de")
) {
return proxy;
#!/bin/bash
JENKINS_SERVER=http://build.rtbrick.com:8080
JOB=$1
JOB_QUERY=/job/${JOB}
CURRENT_BUILD_NUMBER_QUERY=/lastBuild/buildNumber
CURRENT_BUILD_JSON=`curl --silent ${JENKINS_SERVER}${JOB_QUERY}${CURRENT_BUILD_NUMBER_QUERY}`
echo $CURRENT_BUILD_JSON
BUILD_STATUS_QUERY=/$CURRENT_BUILD_JSON/api/json
JOB_STATUS_JSON=`curl --silent ${JENKINS_SERVER}${JOB_QUERY}${BUILD_STATUS_QUERY}`
public class Zero {
public static void main(String[] args) {
int s = 10;
System.out.println(s++ - --s);
System.out.println(++s - s--);
System.out.println(s-- - ++s);
System.out.println(--s - s++);
System.out.println(s++ + --s + s++ + --s);
}
@idefixcert
idefixcert / Highlander.java
Created February 7, 2014 22:21
Singleton the Highlander way
public class Highlander {
private Highlander() {
// Singleton
}
private static class SingletonHolder {
public static final Highlander SINGLETONHOLDER = new Highlander();
}
public static Highlander getInstance() {
@idefixcert
idefixcert / fileupload.xhtml
Created September 10, 2013 22:03
Get primefaces (3.5) fileupload work in IE10
<p:fileUpload fileUploadListener="#{fileUpload.handleFileUpload}"
mode="advanced" dragDropSupport="true" multiple="true"
update="messages" sizeLimit="100000" fileLimit="3"
allowTypes="/(\.|\/)(gif|jpe?g|png)$/" />
<p:growl id="messages" showDetail="true" />
@idefixcert
idefixcert / BootstrapMessageRenderer.java
Last active December 22, 2015 14:48
Bootstrap Message Renderer for JSF
package at.freelenzer.jsftest.bootstrap;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.faces.application.FacesMessage;
<AnchorPane AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" xmlns:fx="http://javafx.com/fxml" fx:controller="at.freelenzer.dagobert.fx.accounts.AccountsPresenter">
leftSide.getChildren().add(accountsView.getView());
import java.util.HashMap;
import java.util.Map;
@SuppressWarnings("boxing")
public enum IndexStrategy {
DEFAULT(0), FASTINDEX(1), FINEGRAINED(2);
private final int value;
private IndexStrategy(int value) {
this.value = value;
}
@idefixcert
idefixcert / StaticGenericFactory.java
Created April 28, 2013 12:40
StaticGenericFactory
public class Test {
public void test() {
Map<String, String> test = newHashMap();
}
public static <K,V> Map<K,V> newHashMap() {
return new HashMap<K, V>();
}
}
@idefixcert
idefixcert / ArrayListInitialization.java
Created April 28, 2013 12:39
Fast ArrayList Initialization
private static String[] array = new String[]{"Test", "Test"};
private static List<String> arraylist = new ArrayList<String>() {
{
add("Test");
add("Test");
}
};
private static Map<String,String> map = new HashMap<String,String>() {
{