Skip to content

Instantly share code, notes, and snippets.

View dschulten's full-sized avatar

Dietrich Schulten dschulten

View GitHub Profile
@dschulten
dschulten / JacksonConfigurator.java
Last active September 26, 2022 11:10
Set default timezone of jax-rs jackson provider for deserialization of timestamp to XmlGregorianCalendar JAXB date field.
package de.kommone.kmc.api;
import java.util.TimeZone;
import javax.ws.rs.Produces;
import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;
import com.fasterxml.jackson.databind.ObjectMapper;
@dschulten
dschulten / create-merge-request.sh
Created September 20, 2020 15:49
Portably capture curl exit status, http status code and response body when creating gitlab merge request
#!/bin/sh
# see https://superuser.com/a/862395/1001553 if you can use bash and want to avoid temp file
# let curl fail on error and print response code while redirecting body to file
# read curl stdout into variable
http_status=$(curl --request POST \
--fail \
--silent --write-out '%{http_code}' \
--output response.json \
--url http://gitlab.dzbw.de/api/v4/projects/4560/merge_requests \
version: "3"
services:
web:
image: emilevauge/whoami
networks:
- default
- traefik-net
deploy:
labels:
- "traefik.port=80"
@dschulten
dschulten / grub.cfg for Acer Nitro
Created January 8, 2019 11:46
Acer Nitro 5 AN515-42: Add the following before "quiet splash" in grub.cfg, see https://community.acer.com/en/discussion/555251/unable-to-install-ubuntu-in-my-nitro-an512-42
ivrs_ioapic[4]=00:14.0 ivrs_ioapic[5]=00:00.2
@dschulten
dschulten / DmnConfig.java
Last active December 23, 2018 14:31
Activate Feel Scala Plugin for Camunda Dmn
@Configuration
public class DmnConfig {
/**
* Creates DMN engine with feel-scala engine as default language.
*
* @return engine
* @see <a href="https://github.com/camunda/camunda-engine-dmn">Simple Engine Setup</a>
* @see <a href="https://github.com/camunda/feel-scala/tree/master/feel-engine#how-to-use-it">Using full FEEL language in Camunda DMN</a>
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
@SpringIntegrationTest
@ActiveProfiles("local")
@AutoConfigureMockMvc
@TestPropertySource(properties = {
"my.setting=watchamacallit"
})
public class ApplicationTest {
@dschulten
dschulten / JSONObjectBuilders.java
Last active January 24, 2022 11:31
JsonNodeBuilders
package de.escalon.builders.json;
import net.minidev.json.JSONArray;
import net.minidev.json.JSONObject;
import java.io.Serializable;
/**
@dschulten
dschulten / uber-events.json
Created May 6, 2016 09:50
Sample uber response with nested model data
{
"uber": {
"data": [
{
"rel": [
"self"
],
"url": "http://localhost:8080/webapp/hypermedia-api/events",
"action": "APPEND",
"model": "performer={performer}&workPerformed.name={workPerformed.name}&location={location}&eventStatus={eventStatus}"
@dschulten
dschulten / README.md
Last active November 4, 2015 07:27 — forked from anonymous/README.md
JSON-LD Playground: custom attributes
@dschulten
dschulten / event.jsonld
Last active August 29, 2015 14:06
Editable event
{
"@context": {
"@vocab": "http://schema.org",
"hydra": "http://www.w3.org/ns/hydra/core#"
},
"@id": "http://www.markus-lanthaler.com/hydra/event-api/events/1",
"@type": "Event",
"name": "Walk off the Earth - REVO tour",
"description": "Live in concert",
"startDate": "2014-06-14T20:00:00Z",