Skip to content

Instantly share code, notes, and snippets.

Georgios Andrianakis geoand

Block or report user

Report or block geoand

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
thomasdarimont /
Created Feb 23, 2018
Wait for HTTP Service to become available with timeout (bash)
timeout 40s /bin/bash -c "while ! httping -qc1 http://somehost:8080/app ; do sleep 1 ; done; echo OK" || echo TIMEOUT

If the service cannot be reached within 40s then TIMEOUT will be printed otherwise OK.

joshlong / DynamicIntegration.kt
Last active Jan 6, 2018
Dynamic registration of Spring Integration adapters using functional bean definition with the Spring Framework 5.0 Kotlin DSL.
View DynamicIntegration.kt
package com.example.feed
import com.rometools.rome.feed.synd.SyndEntry
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.builder.SpringApplicationBuilder
import org.springframework.integration.dsl.IntegrationFlows
import org.springframework.integration.feed.dsl.Feed
import org.springframework.integration.handler.GenericHandler
fitzoh /
Created Sep 7, 2017
Canary deploys with spring-cloud-gateway (2.0.0-M1)
public class SpringCloudGatewayApplication {
private final String cookieName = "beta_active";
private final String headerName = "X-Beta-active";
private final String betaActiveValue = "true";
* They're in the beta if they have a cookie or request header set
jeffsheets / ApiSecurityConfig.groovy
Created Sep 6, 2017
Spock Test for Spring Boot Security configuration - showing basic simple examples for unauthenticated users, role based access, and httpBasic logins
View ApiSecurityConfig.groovy
class ApiSecurityConfig extends WebSecurityConfigurerAdapter {
void configureGlobal(AuthenticationManagerBuilder auth) {
protected void configure(HttpSecurity http) {
rgl /
Last active May 12, 2020
Wait for an HTTP endpoint to return 200 OK with Bash and curl
bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9000)" != "200" ]]; do sleep 5; done'
# also check
View splitted_xml_slurping.groovy
// Example of using StAX to split a large XML document and parse a single element using XmlSlurper
import javax.xml.transform.Transformer
import javax.xml.transform.TransformerFactory
import javax.xml.transform.sax.SAXResult
import javax.xml.transform.stax.StAXSource
def url = new URL("")
oza /
Last active Nov 19, 2019
How to run Spark on YARN with dynamic resource allocation


  1. General resource management layer on HDFS
  2. A part of Hadoop


  1. In memory processing framework

Spark on YARN

cy6erGn0m / merge-maps.kt
Created May 20, 2015
Merge two maps with custom reduce function for Kotlin
View merge-maps.kt
private fun <K, V> Map<K, V>.mergeReduce(other: Map<K, V>, reduce: (V, V) -> V = { a, b -> b }): Map<K, V> {
val result = LinkedHashMap<K, V>(this.size() + other.size())
other.forEach { e ->
val existing = result[e.key]
if (existing == null) {
result[e.key] = e.value
else {
staltz /
Last active May 25, 2020
The introduction to Reactive Programming you've been missing
timyates /
Last active May 30, 2016
Implementing Groovy's collate method in Java 8 Streams
import java.util.Arrays;
import java.util.List;
/* Efficiency must be questioned
* Also, no error checking, so could go infinite if called with dodgy params
* (left as an exercise for the reader) ;-)
You can’t perform that action at this time.