Skip to content

Instantly share code, notes, and snippets.

View serpro69's full-sized avatar
🍵
breaking things when they work, so I can fix them later

Særgeir serpro69

🍵
breaking things when they work, so I can fix them later
View GitHub Profile
@serpro69
serpro69 / gist:cb64f93cb721804126babffc2a5cd9b0
Created March 2, 2019 12:28 — forked from in28minutes/gist:b6d9e5737bf0a3c657188e36287eb6b7
Kotlin Programming Language Cheat Sheet Part 1

Intro

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 kotlin.jetbrains.org.

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

Let's get started.

@serpro69
serpro69 / Jenkinsfile
Created April 5, 2018 10:43 — forked from HarshadRanganathan/Jenkinsfile
Jenkins Declarative Pipeline Example
def getProjectName() {
return 'JenkinsPipeline'
}
def getJDKVersion() {
return 'jdk1.8.0_101'
}
def getMavenConfig() {
return 'maven-config'
@serpro69
serpro69 / pipeline.gdsl
Created March 23, 2018 08:38 — forked from fredericrous/pipeline.gdsl
GDSL supporting pipeline declarative
//The global script scope
def ctx = context(scope: scriptScope())
//What things can be on the script scope
contributor(ctx) {
method(name: 'pipeline', type: 'Object', params: [body: Closure])
property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable')
property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder')
property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder')
property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar')
version: '3'
services:
selenoid:
image: "aerokube/selenoid"
environment:
- DOCKER_API_VERSION=1.25
- COMPOSE_API_VERSION=1.25
network_mode: bridge
ports:
- "4444:4444"
@serpro69
serpro69 / intellij-monokai-theme.xml
Created December 8, 2017 12:41 — forked from darekkay/intellij-monokai-theme.xml
Monokai Theme for JetBrains IDEs (IntelliJ IDEA, Webstorm, PhpStorm, PyCharm etc.)
<scheme name="Eclectide Monokai" version="142" parent_scheme="Default">
<colors>
<option name="ADDED_LINES_COLOR" value="295622" />
<option name="ANNOTATIONS_COLOR" value="b2c0c6" />
<option name="CARET_COLOR" value="bbbbbb" />
<option name="CARET_ROW_COLOR" value="" />
<option name="CONSOLE_BACKGROUND_KEY" value="1c1c1c" />
<option name="FILESTATUS_ADDED" value="629755" />
<option name="FILESTATUS_DELETED" value="6c6c6c" />
<option name="FILESTATUS_IDEA_FILESTATUS_DELETED_FROM_FILE_SYSTEM" value="6c6c6c" />
@serpro69
serpro69 / mpdsetup.sh
Created November 14, 2017 08:22 — forked from kurobeats/mpdsetup.sh
From http://dl.53280.de/mpdsetup.sh before it went down
#!/bin/bash
clear
username=$(whoami)
interface=`ip route show | cut -d ' ' -f 3 | head -1`
interface=$(ip route show | awk '{print $NF}' | tail -1)
echo "What is the full path of the directory containing your music?"
read -e -p "> " music_dir
if test -n "$(pgrep pulseaudio)";
then
@serpro69
serpro69 / RestAssuredKotlin.md
Created November 14, 2017 08:20 — forked from outofcoffee/RestAssuredKotlin.md
DSL for using RestAssured with Kotlin

DSL for using RestAssured with Kotlin

Example

        given {
            on {
                get("/orders/123") itHas {
                    statusCode(404)
                }
@serpro69
serpro69 / YarnClientTest.java
Created August 14, 2017 10:32 — forked from ashrithr/YarnClientTest.java
YarnClient example for deleteing user applications
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.hadoop.yarn.api.records.ApplicationId;
import org.apache.hadoop.yarn.api.records.ApplicationReport;
import org.apache.hadoop.yarn.api.records.YarnApplicationState;
import org.apache.hadoop.yarn.client.api.YarnClient;
import org.apache.hadoop.yarn.conf.YarnConfiguration;
import org.apache.hadoop.yarn.exceptions.YarnException;
@serpro69
serpro69 / FIleSystemOperations.java
Created August 14, 2017 10:32 — forked from ashrithr/FIleSystemOperations.java
HDFS FileSystems API example
package com.cloudwick.mapreduce.FileSystemAPI;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;