Skip to content

Instantly share code, notes, and snippets.

@ThomasVille
ThomasVille / spec.json
Created November 13, 2025 08:54
`#[serde(tag)]` conflicts with discriminator property in nested objects
{
"openapi": "3.1.0",
"info": {
"title": "Test",
"description": "Reproduction scenario",
"version": "0.68.0"
},
"components": {
"schemas": {
"PersonResource": {
@ThomasVille
ThomasVille / remove_json_comments.sh
Last active March 28, 2025 09:04
Remove comments from JSON file
# This sed command removes every C-style single line comments (//) from a file that can contain strings delimited by `"`
# (intended for use with JSON files).
# So this JSON:
# {
# "app url": "https://www.example.com" // URL of the application
# }
# becomes:
# {
# "app url": "https://www.example.com"
# }
@ThomasVille
ThomasVille / plplot_multiple_plots.cpp
Last active March 19, 2017 18:27
Plotting multiple plots on the same graph with PLplot
// Output type and file
plsfnam("filename.svg");
plsdev("svg");
plinit();
// Set the canvas to show 2x2 plots
plssub( 2, 2 );
for(int i = 0; i < 4; i++)
{
// Very important ! Go to the next plot spot with plenv