Importing a Sitemap XML into Google Sheets

The Goal In the following short article, we want to import data from an existing sitemap XML file into a new Google Sheet document. The sheet must pull the sitemap via HTTP protocol and extract all the URLs from the sitemap and insert them. into the sheet. Implementation Now let’s implement it .. it only takes 1 minute …​ For demonstration purpose, I’m going to use the sitemap from my old blog, to be found at https://www.hascode.com/sitemap.xml. ...

January 5, 2023 · 2 min · 280 words · Micha Kops

JAX-RS Server API Snippets

Because a lot of my current projects are using JAX-RS in different versions I’d like to write down and share some frequently used snippets for implementing RESTful web-services with the JAX-RS specification here. Using RegEx in Path Expressions Sometimes we need to extract multiple parameters from a path expression e.g. in the following example where year, month and day are fragments if the path. @GET @Path("/orders/{year:\\d{4}}-{month:\\d{2}}-{day:\\d{2}}") @Produces(MediaType.TEXT_PLAIN) public Response getOrders(@PathParam("year") final int year, @PathParam("month") final int month, @PathParam("day") final int day) { return Response.ok("Year: " + year + ", month: " + month + ", day: " + day).build(); } ...

September 28, 2014 · 5 min · 924 words · Micha Kops

Java EE 7 Database Migrations with Liquibase and WildFly

I have written about other database migration frameworks before but in this article I’d like to cover the Liquibase framework in combination with WildFly as Java EE 7 compatible application server. In the following tutorial, we’re going to write a full Java EE 7 book store application with a few steps and with Liquibase on board to create the database structure and insert example data into the database. Thanks to the WildFly Maven Plug-in we even do not need to download and configure the application server but let Maven and the plug-in do the work for us. ...

July 31, 2014 · 9 min · 1771 words · Micha Kops

Linux Snippets

These are not only linux snippets but also bash snippets and snippets using tools that run under Linux, *nix or sometimes even MacOSX, I should reorder this article someday ;) Settings for more reliable bash scripts set -euo pipefail this gives us …​ -e: exit script if a single command fails -u: exit script if an unset variable is used -o pipefail: return value of a pipeline is the status of the last command to exit with a non-zero status, or zero if no command exited with a non-zero status ...

March 1, 2010 · 15 min · 3006 words · Micha Kops

Vim Snippets

Vim Plugin Manager Installation Download it from its GitHub repository or the risky but easy way using curl: curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim Adding Plugins Add a plugin section to the .vimrc: .vimrc call plug#begin() " The default plugin directory will be as follows: " - Vim (Linux/macOS): '~/.vim/plugged' " - Vim (Windows): '~/vimfiles/plugged' " - Neovim (Linux/macOS/Windows): stdpath('data') . '/plugged' " You can specify a custom plugin directory by passing it as the argument " - e.g. `call plug#begin('~/.vim/plugged')` " - Avoid using standard Vim directory names like 'plugin' " Make sure you use single quotes " Gruvbox Theme Plug 'sainnhe/gruvbox-material' " Initialize plugin system " - Automatically executes `filetype plugin indent on` and `syntax enable`. call plug#end() " You can revert the settings after the call like so: " filetype indent off " Disable file-type-specific indentation " syntax off " Disable syntax highlighting ...

March 1, 2010 · 3 min · 568 words · Micha Kops