Skip to content

Instantly share code, notes, and snippets.

View AlexGuironnetRTE's full-sized avatar

Alexandra Guironnet AlexGuironnetRTE

View GitHub Profile
@cheungnj
cheungnj / script.sh
Last active March 6, 2024 02:35
Convert asciidoc to Github Flavored Markdown
# Adapted from https://tinyapps.org/blog/nix/201701240700_convert_asciidoc_to_markdown.html
# Using asciidoctor 1.5.6.1 and pandoc 2.0.0.1
# Install pandoc and asciidoctor
$ sudo apt install asciidoctor
$ sudo wget https://github.com/jgm/pandoc/releases/download/2.0.0.1/pandoc-2.0.0.1-1-amd64.deb
$ sudo dpkg -i pandoc-2.0.0.1-1-amd64.deb
# Convert asciidoc to docbook using asciidoctor
@olih
olih / jq-cheetsheet.md
Last active September 21, 2024 00:05
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@massenz
massenz / JsonSerialize.java
Last active December 7, 2021 15:57
How to convert from JSON to Inet4Address in Java - incidentally, this is the only way to create an InetAddress object for a host that is not DNS-resolvable (see in the example, how it sets both hostname and IP for an arbitrary server).
package com.alertavert.samples;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.net.Inet4Address;
/**
* Simple example to show how to create a Java @link{InetAddress} from a JSON representation.
*
* <p>Jackson will try to use the @link{Inet4Address#Inet4Address(String, int)} constructor, and it