Skip to content

Instantly share code, notes, and snippets.

@rgardien
rgardien / LoadBalancerServerRandomizer.java
Last active August 10, 2018 11:59
LoadBalancerServerRandomizer.java
// a plugin to randomize Edge servers in a Wowza loadbalancer Origin/Edge scenario
// just compile to a .jar, add to the lib folder and add this one to the Server or VHost.xml as per the documentation
// then just add the ServerExtensionRandomizer to always return a random Edge server if all other decisions return more than one server in the end
package com.wowza.plugin.xxx;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@rgardien
rgardien / europeanaCollectionsQueryToAPIQuery.php
Last active February 22, 2016 09:11
Convert a Europeana URL search query into an API query
<?php
/**
* @param $urlQuery Query taken from a www.europeana.eu search query
* @return array Array with input for the query and qf parameter(s) to use in the API
*/
function europeanaCollectionsQueryToAPIQuery($urlQuery) {
// Parameters, not qf's
$parameters = array('MEDIA', 'COLOURPALETTE', 'REUSABILITY');