Skip to content

Instantly share code, notes, and snippets.

View ju-la-berger's full-sized avatar

Justus Lasse Berger ju-la-berger

View GitHub Profile
@ju-la-berger
ju-la-berger / git_commit.sh
Last active September 21, 2017 15:16
How to commit untracked files one by one
git ls-files --others --exclude-standard | while read filename; do git add "$filename" && git commit --message="Add new file '$filename'"; done
@ju-la-berger
ju-la-berger / EnvironmentFromResource.java
Last active September 21, 2017 15:14
Create Spring Environment from Resource (e.g. for unit testing)
package com.github.ju-la-berger;
import java.io.IOException;
import org.springframework.core.env.AbstractEnvironment;
import org.springframework.core.io.support.ResourcePropertySource;
public class EnvironmentFromResource extends AbstractEnvironment {
public EnvironmentFromResource(final String location) {
@ju-la-berger
ju-la-berger / producer.sh
Created September 2, 2020 15:34
Read chunks from log file via bash
#!/bin/bash
set -e
cd "$(dirname "${BASH_SOURCE[0]}")"
do_exit() {
local -r the_result=$1
echo