Skip to content

Instantly share code, notes, and snippets.

View geoand's full-sized avatar

Georgios Andrianakis geoand

View GitHub Profile
```
[OSEv3:children]
masters
nodes
etcd
[OSEv3:vars]
ansible_user=root
public_ip_address=192.168.99.50
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 April 2, 2018 14:51
New configuration for Spring Boot
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
apiVersion: v1
data:
config: |
policy: enabled
template: |-
initContainers:
- name: istio-init
image: docker.io/istio/proxy_init:0.6.0
args:
- "-p"
/**
* 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) }}
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) {
fun <T> List<T>.collate(size: Int, step: Int = size): List<List<T>> {
require(size >= 0) {"size must not be negative"}
require(step <= size) {"step must be at most equal to size"}
return collateRec(this, size, step, listOf())
}
private tailrec fun <T> collateRec(list : List<T>, size: Int, step: Int, accumulator: List<List<T>>) : List<List<T>> {
if(list.isEmpty()) {
return accumulator
@geoand
geoand / introrx.md
Created July 28, 2016 11:44 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@geoand
geoand / iddfs.groovy
Created April 28, 2016 12:35
Groovy implementation of a simplistic Iterative deepening depth-first search
import groovy.transform.TailRecursive
import groovy.transform.ToString
@ToString(includePackage = false)
class Node<T> {
T data
List<Node<T>> nodes = []
}
final builder = new ObjectGraphBuilder(classLoader: getClass().classLoader)
@geoand
geoand / gist:97b40fc0170df387cb03
Created February 12, 2016 14:43
List Subsets in Groovy (inspired from Java 8 in Action#13.2.4)
def list = [1,4,9]
println subsets(list)
List<List<Integer>> subsets(List<Integer> list) {
if(!list) {
return [[]]
}
final List<List> directSubs = list.tail().collect {