Skip to content

Instantly share code, notes, and snippets.

package com.redgyro.education.`oo-classes-functions-inheritance`
fun main(args: Array<String>) {
/**
* Kotlin has 4 access modifiers
* Just like in Java there is "public", "private", "protected"
*
* And there is "internal"
*
* Default access modifier
// A simple Spring Boot Entity written in Kotlin
data class PersonEntity(
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
val id: Long = -1,
val name: String = ""
)
@johanvergeer
johanvergeer / Order.kt
Last active March 30, 2018 19:04
Simple way to encapsulate a collection in a Kotlin Spring Entity
import javax.persistence.*
@Entity
data class OrderEntity(
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
val id: Long? = -1,
var firstName: String,
-- Create a test database
create database hrDB;
use [hrDB];
go
create schema dbo;
go
-- Create a user that can insert values while the schema updates are executed

Replace container while retaining volume

This script is intended to demonstrate how a Docker volume can be # reused by a new container. The image we'll use is SQL Server 2017

The scripts are baed on the official Microsoft documentation

Create a new container and volume

Create a new container from the mssql-server-linux image

@johanvergeer
johanvergeer / download-docker-compose.sh
Last active September 28, 2018 08:38
Docker Jenkins
cd /usr/local/bin
wget https://github.com/docker/compose/releases/download/1.13.0/docker-compose-Linux-x86_64
mv docker-compose* docker-compose
chmod +x docker-compose
@johanvergeer
johanvergeer / _macbook-setup.md
Last active October 13, 2018 09:08
My Macbook setup
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
" Kotlin Vim Plugin # https://github.com/udalov/kotlin-vim
Plugin 'udalov/kotlin-vim'
" Syntax checking # https://github.com/vim-syntastic/syntastic
@johanvergeer
johanvergeer / .editorconfig
Last active April 23, 2019 06:43
My default EditorConfig for C# projects
# Rules in this file were initially inferred by Visual Studio IntelliCode from the C:\Workspace\Uniforms codebase based on best match to current usage at 12-4-2019
# You can modify the rules from these initially generated values to suit your own policies
# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
[*.cs]
#Core editorconfig formatting - indentation
#use soft tabs (spaces) for indentation
indent_style = space
indent_size = 4
@johanvergeer
johanvergeer / PersonModel.cs
Last active May 19, 2019 13:56
Simple Person model
public class Person
{
public string Name { get; set; }
public int Age { get; set; }
public bool IsValid => !string.IsNullOrWhiteSpace(this.Name);
}