Skip to content

Instantly share code, notes, and snippets.

View kthoms's full-sized avatar
👨‍💻
Working in spare time on Operaton

Karsten Thoms kthoms

👨‍💻
Working in spare time on Operaton
View GitHub Profile
@kthoms
kthoms / list-modules-with-tests.sh
Last active November 14, 2024 17:32
Lists directories of Java projects containing JUnit 4 / 5 test cases.
#!/usr/bin/env sh
function count_junit5_tests () {
grep -R --include \*.java "import org.junit.jupiter.api.Test" -m 1 -o -h "$1" | wc -l
}
function count_junit4_tests () {
grep -R --include \*.java "import org.junit.Test" -m 1 -o -h "$1" | wc -l
}
function marker () {
if [ "$1" -eq "0" ]; then
echo "✅"
@kthoms
kthoms / mvn-list-active-profiles.sh
Last active November 9, 2024 08:53
Maven: list active profiles
mvn help:active-profiles | grep "source:" | awk '{print $2}' | sort -u
<?xml version='1.0' encoding='UTF-8'?>
<?compositeArtifactRepository version='1.0.0'?>
<repository name='TMF Xtext Update Site (Milestones)' type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1.0.0'>
<properties size='1'>
<property name='p2.timestamp' value='1524687543354'/>
</properties>
<children size='7'>
<child location='head/S201610211140'/>
<child location='head/S201612190948/'/>
<child location='head/S201701270250/'/>
# Install required packages
sudo apt-get update
sudo apt-get --assume-yes install git g++ cmake autoconf libtool doxygen graphviz pkg-config openjdk-8-jdk asciidoc
# Define version variables
export VERSION_DBUS=1.10.24
export VERSION_CAPICXX_CORE_RUNTIME=3.1.12.4
export VERSION_CAPICXX_CORE_GENERATOR=3.1.12.2
export VERSION_CAPICXX_DBUS_RUNTIME=3.1.12.4
export VERSION_CAPICXX_DBUS_GENERATOR=3.1.12.1
@kthoms
kthoms / 02_drive_and_turn.py
Created April 4, 2017 12:39
Cozmo tutorial program: Drive and turn
'''Drive And Turn
Make Cozmo drive forwards and then turn 90 degrees to the left.
'''
import cozmo
from cozmo.util import degrees, distance_mm, speed_mmps
def cozmo_program(robot: cozmo.robot.Robot):
@kthoms
kthoms / Domainmodel-2.xtext
Last active March 21, 2016 09:15
Operator overloading in Xbase
OpOr:
'||' | 'OR';
OpAnd:
'&&' | 'AND';
@kthoms
kthoms / OperatorMappingCustom
Created March 14, 2016 21:05
A custom implementation of org.eclipse.xtext.xbase.scoping.featurecalls.OperatorMapping that adds alternative to keywords '&&' and '||'
package org.eclipse.xtext.example.domainmodel;
import static org.eclipse.xtext.naming.QualifiedName.*;
import javax.inject.Singleton;
import org.eclipse.xtext.naming.QualifiedName;
import org.eclipse.xtext.xbase.scoping.featurecalls.OperatorMapping;
@Singleton
package com.rhenus.fl.frame.server.services;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.scout.commons.logger.IScoutLogger;
import org.eclipse.scout.commons.logger.ScoutLogManager;
import org.eclipse.scout.rt.server.IServerSession;
import org.eclipse.scout.rt.server.IServerSessionProvider;
@kthoms
kthoms / busmod.spray
Created June 23, 2013 16:33
Spray Tuturial: Spray definition
import BusinessDomainDsl.*
diagram busmod for BusinessDomainDsl.BusinessDomainModel
class BusinessClass {
shape SimpleClassShape {
name into businessClassText
}
behavior {
create into types palette "Shapes"
@kthoms
kthoms / busmod.shape
Created June 23, 2013 16:30
Spray Tutorial: Shape definition
shape SimpleClassShape {
rectangle {
position(x=0, y=0)
size(width=100, height=25)
text {
position(x=5, y=0)
size(width=95, height=25)
id = businessClassText
}
}