Skip to content

Instantly share code, notes, and snippets.

View gclaussn's full-sized avatar

Gabor Claußnitzer gclaussn

  • cimt ag
  • Hamburg, Germany
View GitHub Profile
@gclaussn
gclaussn / nodejs-test-private-function-using-vm-script.md
Last active January 14, 2023 16:35
Node.js - Test JavaScript function without export

How to test a JavaScript function that is not exported?

This example can be used to test functions in Google Apps Script code. It uses the Node.js VM module to create an ad hoc script, which consists of the function's code to be tested as well as an invocation of the function to be evaluated. The result of the script is returned by execute and can be asserted afterwards.

If the function uses global objects (e.g. DriveApp, SpreadsheetApp or GmailApp), stub implementations can be provided as context for the script execution.

@gclaussn
gclaussn / raspberry_pi4_docker.md
Last active August 5, 2021 17:51
Raspberry PI 4: Docker Installation

Networking

Get MAC address (used for the static DHCP entry in router)

cat /sys/class/net/eth0/address

Disable DHCP client daemon:

@gclaussn
gclaussn / spring-boot-web-security-configuration.md
Last active January 4, 2024 17:10
Spring Boot - Web security configuration with LDAP

Add Maven dependencies:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
  <groupId>org.springframework.security</groupId>
  <artifactId>spring-security-ldap</artifactId>
@gclaussn
gclaussn / spring-data-jpa-persistence.md
Last active September 7, 2018 12:36
Spring - Data JPA Persistence

Add Maven dependency:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

Persistence configuration for production:

@gclaussn
gclaussn / robotframework-java-library.md
Last active May 15, 2023 19:29
robotframework-java-library

Custom Java libraries for the Robot Framework can be written as:

  • Static keyword library
  • Dynamic keyword library

Create a Maven project with following dependencies:

<dependency>
  <groupId>org.robotframework</groupId>
@gclaussn
gclaussn / spring-boot-h2-console.md
Last active November 7, 2018 21:00
Spring Boot - Enable H2 web console

Add H2 to Maven dependencies

<dependency>
  <groupId>com.h2database</groupId>
  <artifactId>h2</artifactId>
  <scope>runtime</scope>
</dependency>