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
View Kotlin Iterable.countBy extension
fun <T, M> Iterable<T>.countBy(transformer: (T) -> M) : Map<M, Int> {
val emptyMap = mapOf<M, Int>()
return this.fold(emptyMap) {accumulator, item ->
val transformedItem = transformer(item)
accumulator + Pair(transformedItem, accumulator.getOrElse(transformedItem, {0}) + 1)
}
}
View openshift-3.7.ansible-rpm-error
PLAY [Create initial host groups for localhost] ********************************************************************************************
TASK [include_vars] ************************************************************************************************************************
ok: [localhost]
PLAY [Initialization Checkpoint Start] *****************************************************************************************************
skipping: no hosts matched
PLAY [Populate config host groups] *********************************************************************************************************
View istio-java-api-48
/home/gandrian/.sdkman/candidates/java/8.0.181-zulu/bin/java -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/home/gandrian/software/IntelliJ/idea-IU-183.2153.8/lib/idea_rt.jar=35895:/home/gandrian/software/IntelliJ/idea-IU-183.2153.8/bin -Dfile.encoding=UTF-8 -classpath /home/gandrian/software/IntelliJ/idea-IU-183.2153.8/lib/idea_rt.jar:/home/gandrian/software/IntelliJ/idea-IU-183.2153.8/plugins/junit/lib/junit-rt.jar:/home/gandrian/software/IntelliJ/idea-IU-183.2153.8/plugins/junit/lib/junit5-rt.jar:/home/gandrian/.sdkman/candidates/java/8.0.181-zulu/jre/lib/charsets.jar:/home/gandrian/.sdkman/candidates/java/8.0.181-zulu/jre/lib/ext/cldrdata.jar:/home/gandrian/.sdkman/candidates/java/8.0.181-zulu/jre/lib/ext/dnsns.jar:/home/gandrian/.sdkman/candidates/java/8.0.181-zulu/jre/lib/ext/jaccess.jar:/home/gandrian/.sdkman/candidates/java/8.0.181-zulu/jre/lib/ext/localedata.jar:/home/gandrian/.sdkman/candidates/java/8.0.181-zulu/jre/lib/ext/nashorn.jar:/home/gandrian/.sdkman/candidates/java/8.0.181-zulu/jre/
View simple pom
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>indy-maven-generate-repo-test</artifactId>
<version>1.0-SNAPSHOT</version>
View ocp-3.10-failure-inventory
```
[OSEv3:children]
masters
nodes
etcd
[OSEv3:vars]
ansible_user=root
public_ip_address=192.168.99.50
View ocp-3.10-failure
ASK [openshift_node : Ensure old system path is set] ****************************************************************************************************************************************************************************
changed: [192.168.99.50] => (item=/etc/origin/openvswitch)
changed: [192.168.99.50] => (item=/var/lib/kubelet)
changed: [192.168.99.50] => (item=/opt/cni/bin)
TASK [openshift_node : Pre-pull node system container image] *********************************************************************************************************************************************************************
fatal: [192.168.99.50]: FAILED! => {"msg": "The conditional check ''Pulling layer' in pull_result.stdout' failed. The error was: error while evaluating conditional ('Pulling layer' in pull_result.stdout): Unable to look up a name or access an attribute in template string ({% if 'Pulling layer' in pull_result.stdout %} True {% else %} False {% endif %}).\nMake sure your variable name does not contain invalid
@geoand
geoand / gist:85eb614336c77a8a3c4d57efb5a6d4e5
Created Apr 2, 2018
New configuration for Spring Boot
View gist:85eb614336c77a8a3c4d57efb5a6d4e5
product:
name: spring-boot
abbreviation: spring-boot
stage: GA
issueTrackerUrl: http://issues.jboss.org/browse/SB
version: 1.5.10
milestone: DR20180330
group: spring-boot-1.5-all
defaultBuildParameters:
environmentId: 1
View default istio-inject configmap
apiVersion: v1
data:
config: |
policy: enabled
template: |-
initContainers:
- name: istio-init
image: docker.io/istio/proxy_init:0.6.0
args:
- "-p"
View Kotlin Collection.combine extension
/**
* Method extension code
*/
fun <T1, T2> Collection<T1>.combine(other: Iterable<T2>): List<Pair<T1, T2>> {
return combine(other, {thisItem: T1, otherItem: T2 -> Pair(thisItem, otherItem) })
}
fun <T1, T2, R> Collection<T1>.combine(other: Iterable<T2>, transformer: (thisItem: T1, otherItem:T2) -> R): List<R> {
return this.flatMap { thisItem -> other.map { otherItem -> transformer(thisItem, otherItem) }}
View Tail recursive binary search in Kotlin
tailrec fun <T : Comparable<T>> binarySearch(list: List<T>, item: T, startIndex: Int = 0, endIndex: Int = list.size - 1): Int {
if (endIndex < startIndex ) {
return -1
} else if (startIndex == endIndex) {
return if (item == list[startIndex]) startIndex else -1
} else if (endIndex == startIndex + 1) {
if (list[startIndex] == item) {
return startIndex
}
else if(list[endIndex] == item) {
You can’t perform that action at this time.