View docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.7" | |
# this file is taken from https://github.com/opf/openproject-deploy/blob/stable/11/compose/docker-compose.yml, replaced | |
# the apache proxy with jwilder/nginx-proxy and the companion enabling ssl support | |
networks: | |
frontend: | |
backend: | |
volumes: | |
pgdata: |
View prepare-machine.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Docker | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable edge" | |
apt-get install -y docker-ce | |
sudo usermod -aG docker ubuntu | |
# Install Docker Compose | |
curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
chmod +x /usr/local/bin/docker-compose | |
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose |
View YourSolrContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.wellnerbou.solr; | |
import de.wellnerbou.solr.CollectionAwareEntityInformationFacade; | |
import org.apache.solr.client.solrj.SolrClient; | |
import org.apache.solr.client.solrj.impl.HttpSolrClient; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.data.solr.core.SolrTemplate; |
View Repository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.wellnerbou.solr; | |
import org.springframework.data.domain.Page; | |
import org.springframework.data.domain.Pageable; | |
import org.springframework.data.solr.core.SolrOperations; | |
import org.springframework.data.solr.core.query.SimpleQuery; | |
import org.springframework.data.solr.repository.query.SolrEntityInformation; | |
import org.springframework.data.solr.repository.support.SimpleSolrRepository; | |
public class YourRepository extends SimpleSolrRepository<YourSolrDocument, String> { |
View CollectionAwareEntityInformationFacade.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.wellnerbou.solr; | |
import org.springframework.data.solr.core.mapping.SimpleSolrMappingContext; | |
import org.springframework.data.solr.repository.query.SolrEntityInformation; | |
import org.springframework.data.solr.repository.support.SolrEntityInformationCreatorImpl; | |
public class CollectionAwareEntityInformationFacade<T, ID> implements SolrEntityInformation<T, ID> { | |
private SolrEntityInformation<T, ID> solrEntityInformation; | |
private String collectionName; |
View example.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* First example from https://commons.apache.org/proper/commons-configuration/userguide/howto_reloading.html#Reloading_File-based_Configurations | |
*/ | |
Parameters params = new Parameters(); | |
// Read data from this file | |
File propertiesFile = new File("config.properties"); | |
ReloadingFileBasedConfigurationBuilder<FileBasedConfiguration> builder = | |
new ReloadingFileBasedConfigurationBuilder<FileBasedConfiguration>(PropertiesConfiguration.class) |
View ReloadablePropertiesTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.commons.configuration2.FileBasedConfiguration; | |
import org.apache.commons.configuration2.PropertiesConfiguration; | |
import org.apache.commons.configuration2.builder.ConfigurationBuilderEvent; | |
import org.apache.commons.configuration2.builder.ReloadingFileBasedConfigurationBuilder; | |
import org.apache.commons.configuration2.builder.fluent.Parameters; | |
import org.apache.commons.configuration2.event.Event; | |
import org.apache.commons.configuration2.event.EventListener; | |
import org.apache.commons.configuration2.ex.ConfigurationException; | |
import org.junit.Assert; | |
import org.junit.Before; |
View page-flip-corner.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View switch-java.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -u | |
JAVA7="/opt/jdk1.7.0_80" | |
JAVA8="/opt/jdk1.8.0_31" | |
# Assuming you have $JAVA_SYMLINK/bin in your path, in this case "/opt/jdk/bin" | |
JAVA_SYMLINK="/opt/jdk" | |
NEW_JAVA=$JAVA7 | |
current=`readlink $JAVA_SYMLINK` |
View embedded-hover-footnotes.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Inject this code in your blog footer of your Ghost blog */ | |
var createTooltip = function(tooltiptext) { | |
var tooltip = document.createElement('span'); | |
tooltip.setAttribute('class', 'tooltiptext'); | |
tooltip.innerHTML = tooltiptext; | |
return tooltip; | |
} | |
var appendTooltipTo = function(element, tooltipText) { | |
element.append(createTooltip(tooltipText)); | |
} |
NewerOlder