Skip to content

Instantly share code, notes, and snippets.

Dominik Przybysz alien11689

Block or report user

Report or block alien11689

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 generics
interface PacketTranscoder
open class Packet
class StringPacket(val body: String) : Packet()
interface PacketDecoder<out T : Packet> : PacketTranscoder {
fun decode(client: String, buf: Array<String>): T
alien11689 / kotlin + spock build.gradle
Last active Sep 4, 2018
Gradle config for kotlin and spock test cooperation
View kotlin + spock build.gradle
buildscript {
repositories {
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.0-beta-1103"
apply plugin: "kotlin"
View .travis.yml
language: java
- oraclejdk7
- oraclejdk8
alien11689 / script.js
Created Dec 2, 2015
Template for java script file
View script.js
'use strict';
View MyScript.kt
fun String.isPhoneNumber() = matches(Regex("\\d{11}"))
alien11689 / hoog.bash
Created Jan 30, 2016
Simple hoogle usage
View hoog.bash
function hoog {
if [ -z $count ] ; then
hoogle -q -c "$search" | grep -v -e "^Searching for:" | awk 'BEGIN { a = 1 } { print a ") " $(NF-NF) ; a = a + 1 }'
hoogle -q -c -i -s $count "$search"
View output
$ groovy -version
Groovy Version: 2.4.7 JVM: 1.8.0_91 Vendor: Oracle Corporation OS: Linux
$ groovy test.groovy
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/home/alien/test.groovy: 6: Apparent variable 'name' was found in a static scope but doesn't refer to a local variable, static field or class. Possible causes:
You attempted to reference a variable in the binding or an instance variable from a static context.
You misspelled a classname or statically imported field. Please check the spelling.
You attempted to use a method 'name' but left out brackets in a place not allowed by the grammar.
@ line 6, column 16.
View output
$ groovy test.groovy
Caught: groovy.lang.MissingPropertyException: No such property: foo for class: Foo
groovy.lang.MissingPropertyException: No such property: foo for class: Foo
at Foo$_bar_closure1.doCall(test.groovy:10)
at Foo$ Source)
alien11689 / gist:0cc153108ff72a30b1af1db01b15833a
Created Aug 21, 2016 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1
View gist:0cc153108ff72a30b1af1db01b15833a


Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

You can’t perform that action at this time.