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
geoand / gist:12f1cc17f802f5e6b263
Last active Nov 10, 2015
Groovy - Guava classical set operations
View gist:12f1cc17f802f5e6b263
@Grab(group='', module='guava', version='18.0')
import static*
def first = ['a', 'b', 'c'] as Set
def second = ['b', 'c', 'd', 'e'] as Set
geoand / gist:79a44ad2128059349ab4
Created Nov 18, 2015
Tshark capture local traffic outgoing TCP or UDP traffic with host resolution
View gist:79a44ad2128059349ab4
tshark -c 50 -NnNC -E header=y -Tfields -e col.Protocol -e ip.dst -e ip.dst_host -e tcp.dstport -e udp.dstport -f "host $(hostname --ip-address) and (tcp or udp) and not (port 53)"
geoand / gist:97b40fc0170df387cb03
Created Feb 12, 2016
List Subsets in Groovy (inspired from Java 8 in Action#13.2.4)
View gist:97b40fc0170df387cb03
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 {
geoand / iddfs.groovy
Created Apr 28, 2016
Groovy implementation of a simplistic Iterative deepening depth-first search
View iddfs.groovy
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 /
Created Jul 28, 2016 — forked from staltz/
The introduction to Reactive Programming you've been missing
View Kotlin List.collate
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
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) {
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 -> { otherItem -> transformer(thisItem, otherItem) }}
View default istio-inject configmap
apiVersion: v1
config: |
policy: enabled
template: |-
- name: istio-init
- "-p"
geoand / gist:85eb614336c77a8a3c4d57efb5a6d4e5
Created Apr 2, 2018
New configuration for Spring Boot
View gist:85eb614336c77a8a3c4d57efb5a6d4e5
name: spring-boot
abbreviation: spring-boot
stage: GA
version: 1.5.10
milestone: DR20180330
group: spring-boot-1.5-all
environmentId: 1
You can’t perform that action at this time.