Skip to content

Instantly share code, notes, and snippets.

@johanvergeer
johanvergeer / create_and_restore_backup.md
Last active October 9, 2020 18:22
Create and replace database backup in Docker

Create and restore a database backing using Docker

This script is intended to demonstrate how a backup can be created and restored using Docker containers. 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

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

-- 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
@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,
// A simple Spring Boot Entity written in Kotlin
data class PersonEntity(
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
val id: Long = -1,
val name: String = ""
)
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
#!/usr/bin/env bash
GIST_ID=${1}
# Check if the GIST_ID param has a value
if [ -z "$GIST_ID" ];
then
echo 'GIST_ID is a required parameter';
else
@johanvergeer
johanvergeer / ExportTableHeaders.p
Created December 6, 2017 11:01
Progress OpenEdge Export column names
/*------------------------------------------------------------------------
File : Export table headers
Purpose : Gist for exporting table headers in Progress OpenEdge
Description :
Author(s) : Johan Vergeer. With thanks to TheDropper at
https://stackoverflow.com/questions/44204335/how-to-add-column-name-while-export-csv-in-progress-4gl#44205839
Created : 6 december 2017
----------------------------------------------------------------------*/
DEF VAR hTable AS HANDLE NO-UNDO.