Skip to content

Instantly share code, notes, and snippets.

View erikvullings's full-sized avatar

Erik Vullings erikvullings

View GitHub Profile
@erikvullings
erikvullings / toEnglish.vba
Last active February 15, 2024 10:17
Change the language of your PowerPoint presentation
'Change the language of your PowerPoint
'In newer PowerPoint version, you need to first save your PowerPoint with macros enabled.
'Go to the VIEW tab, select MACROS (at the right), enter a name, e.g. toEnglish, and press create to enter below text.
'Now you can run the macro from the same menu.
'Alternatively, but less complete, go to the VIEW tab, select OUTLINE, select all slides (using CTRL-A).
'Now go to the REVIEW tab, select Language, and change the proofing language.
'Also make sure that you set the WINDOWS Language (taskbar, bottom right) to the preferred language, otherwise all new text
'will have the same problem (Press CTRL + WINDOWS + SPACE to switch the Keyboard input language).
Option Explicit
Sub toEnglish()
@erikvullings
erikvullings / xml2json.ts
Last active November 18, 2023 17:39
Convert XML to JSON using the browser's DOMParser without external dependencies.
export interface IObject {
[key: string]: any;
}
/*
This work is licensed under Creative Commons GNU LGPL License.
License: http://creativecommons.org/licenses/LGPL/2.1/
Version: 0.9
Author: Stefan Goessner/2006,
Conversion: Erik Vullings/2021 converted to TypeScript
@erikvullings
erikvullings / deep-copy.ts
Last active October 5, 2023 13:27
Deep copy or clone in TypeScript
/**
* Deep copy function for TypeScript.
* @param T Generic type of target/copied value.
* @param target Target value to be copied.
* @see Source project, ts-deepcopy https://github.com/ykdr2017/ts-deepcopy
* @see Code pen https://codepen.io/erikvullings/pen/ejyBYg
*/
export const deepCopy = <T>(target: T): T => {
if (target === null) {
return target;
@erikvullings
erikvullings / README.md
Created September 4, 2023 08:53
Sort photos by EXIF date taken in a folder structure (WINDOWS).

Introduction

My camera photos on my phone all end up in one big folder. I wanted to sort them by date taken in a simple format year-month format, YYYY-MM. I tried the application PhotoMove, but unfortunately, this simple requirement is only available with the PRO version, so instead, I've asked ChatGPT to create a PowerShell script for me.

Usage:

  1. Download the Windows version from exif tool and unzip it into a folder. Make sure that the name is exiftool.exe (in my case, it had a weird name exiftool(-k).exe so rename it if that's the case).
  2. Save the PowerShell script you can find below in the same folder.
  3. Open a PowerShell window (WIN+R and enter powershell)
  4. Run the script ./sort.ps1
@erikvullings
erikvullings / .env
Created September 1, 2023 15:43
Docker setup with Traefik as a reverse proxy + let's encrypt certificates, keycloak + postgres as identity provider, and a simple service that is protected by it
POSTGRESQL_PASSWORD="PASSWORD"
POSTGRESQL_POSTGRES_PASSWORD="PASSWORD"
KEYCLOAK_ADMIN_PWD="PASSWORD"
HOST="LOCALHOST"
EMAIL="YOUR.EMAIL"
@erikvullings
erikvullings / Docker-compose.yml
Created May 22, 2023 09:40
Traefik reverse proxy settings in Docker (swarm), including strip path prefix
---
version: "3.3"
networks:
icem-net:
driver: overlay
attachable: true
services:
reverse-proxy:
@erikvullings
erikvullings / README.md
Last active May 19, 2023 16:31
Create a new Docker volume and fill it with local data

Create Docker volume

When moving from a local development environment to the cloud, e.g. Docker swarm or Kubernetes, you often need a way to access local files. However, in the cloud your local file system cannot be accessed anymore, so you need a way to copy your local files to a volume and mount that instead. This is the purpose of the script. You supply it with the volume name (e.g. schemas) and the local folder containing the schemas, e.g. ../../schemas, and a schemas volume is created, containing all data that is copied into the container.

./create_volume.sh schemas ../../schemas