Skip to content

Instantly share code, notes, and snippets.

@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.
#!/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
class PersonService:
@property
def person_repo(self) -> PersonRepo:
return PersonRepoFactory().create()
def set_name(self, person_id: int, new_name: str) -> None:
p = self.person_repo.find(person_id)
p.name = new_name
self.person_repo.add_or_update(p)
class Dog(Mammal):
pass
class Cat(Mammal):
pass
TMammal = TypeVar("TMammal", bound=Mammal)
class MammalCollection(Generic[TMammal]):
def __init__(self, *mammals: TMammal) -> None:
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<body>
<scene id="scene1">
<label t="translate(0,346)">
<tspan x="0" y="0em">A Comix Sample</tspan>
</label>
<actor t="translate(131,49)" pose="-11,9|-5,117|-11,99|-11,89|-11,79|-11,59|-16,34|-21,9|-6,34|-1,9|-18,79|-18,59|-6,79|-1,59">
@johanvergeer
johanvergeer / README.md
Last active January 31, 2021 12:45
Toggle between presentation and coding mode in VS Code using Settings Cycler plugin
@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

@johanvergeer
johanvergeer / iterm-setup.md
Last active February 4, 2020 14:14
My iTerm setup

This Gist describes how I setup iTerm

Basic setup

  1. Install Homebrew
  2. Install oh-my-zsh
  3. ssh-keygen

Powerlevel10K

// Create a component, which is global and can be used anywhere
// in the application
const Hello = Vue.component(
'Hello', // Name of the component
{ templdate: '<span>Hello</span>' } // Options object, which contains a template
)
new Vue({
template: '<div><Hello/> there</div>', // Hardcoded 'Hello' is replated with the component
el: '#app'
@johanvergeer
johanvergeer / Program.cs
Last active May 27, 2019 19:14
Check for 10 million Guids whether they are a UUID version 4. This Gist is used in my blog post https://johanvergeer.github.io/posts/net-guid-uuid-version
/// <summary>
/// Simple script to check whether a C# Guid is really a UUID version 4.
/// </summary>
class Program
{
static void Main(string[] args)
{
Console.WriteLine($"{"Current",-10}{"Errors found",-10}");
Console.WriteLine($"{"-------",-10}{"------------",-10}");