Skip to content

Instantly share code, notes, and snippets.

View sorenlouv's full-sized avatar

Søren Louv-Jansen sorenlouv

View GitHub Profile
@sorenlouv
sorenlouv / rompt-epub-to-idml-en.md
Created June 8, 2026 11:15
Prompt: ePub to idml format (engelsk)

Task: Correct an EPUB's spelling and deliver it as a print-ready InDesign (IDML) file

Goal

Fix the spelling mistakes in a book (EPUB) and flow the corrected text into the publisher's InDesign template, producing a ready-to-open IDML — in the template's house styles, with the layout and front matter intact — plus a clear report of every change. You're a capable agent: this describes the goal and the pitfalls, not step-by-step instructions. Choose your own methods.

Inputs I'll provide

  • The EPUB (final text).
@sorenlouv
sorenlouv / prompt-epub-to-idml-dk.md
Last active June 8, 2026 11:15
Prompt: ePub to idml format (dansk)

OPGAVE: Ret stavefejl i en EPUB og levér teksten i en InDesign-skabelon (IDML)

Mål

Ret stavefejlene i en EPUB-bog og placér den rettede tekst i forlagets InDesign-skabelon, så resultatet er en færdig IDML-fil, der kan åbnes direkte — i skabelonens egne formater, med layout og indledende materiale (titelblad, kolofon, dedikation) bevaret. Levér desuden en ændringsrapport over hver rettelse.

Hvad jeg giver dig

  • EPUB-filen (den endelige tekst).
@sorenlouv
sorenlouv / ecs-otel-alias.md
Last active January 14, 2026 14:36
Elasticsearch ECS to OTel aliases
@sorenlouv
sorenlouv / _doc_count_example.md
Last active September 21, 2023 14:53
`_doc_count` example

Setup

PUT doc-count-fun

POST doc-count-fun/_doc
{
  "_doc_count": 10,
  "@timestamp": "2023-09-14T10:00:00.477Z"
}
@sorenlouv
sorenlouv / vurderingsportal-roadname.md
Last active September 15, 2023 21:10
Vurderingsportal: søg efter vejnavn

Available fields to filter by:

  • adresseID
  • adgangsAdresseID
  • vurderingsEjendomID
  • vurderingsaar
  • juridiskKategori
  • juridiskUnderkategori
  • propertyValue
  • groundValue
@sorenlouv
sorenlouv / pagination-vurderingsportalen.MD
Last active September 12, 2023 20:42
Paginating vurderingsportalen.dk

Der kan max trækkes ca. 5000 boliger via api'et af gangen. Man er derfor nødt til at bruge pagination og filtering for at få det hele med.

Pagination

Pagination, page 1: Hent de første 5000 boliger i 2300 (København S)

Vis curl command
@sorenlouv
sorenlouv / CommitsByAuthor.gql
Created August 26, 2022 08:22
Example of a graphql query
query CommitsByAuthor($authorId: ID, $commitPath: String, $dateSince: GitTimestamp, $dateUntil: GitTimestamp, $maxNumber: Int!, $repoName: String!, $repoOwner: String!, $sourceBranch: String!) {
repository(owner: $repoOwner, name: $repoName) {
ref(qualifiedName: $sourceBranch) {
target {
... on Commit {
history(first: $maxNumber, author: {id: $authorId}, path: $commitPath, since: $dateSince, until: $dateUntil) {
edges {
node {
...SourceCommitWithTargetPullRequestFragment
}
@sorenlouv
sorenlouv / cypress-tips.md
Last active September 1, 2022 18:40
Cypress tips and tricks

Don't await Cypress methods

Given this backend task:

// plugins.ts
const plugin: Cypress.PluginConfig = (on, config) => {
  on('task', {
    async waitForMe(ms: number) {
 return new Promise((resolve) => {
@sorenlouv
sorenlouv / macos-fix.md
Last active May 25, 2021 08:21
"UNTRUSTED_CERT_TITLE" while updating MacOS

Fix the date

Automatic fix

Open the terminal and set the correct date:

ntpdate -u time.apple.com
@sorenlouv
sorenlouv / jest-run-timers-until-resolved.ts
Last active April 1, 2020 08:10
Simplifies testing promise-returning-functions that executes timers (setTimeout / setInterval). The helper `runTimersUntilResolved` will run the timers repeatedly until the promise resolves. Jest helper.
/*
* Run timers (setInterval/setTimeout) every tick continuously until the promise has been resolved
*/
async function runTimersUntilResolved(fn: () => Promise<any>) {
jest.useFakeTimers();
let isResolved = false;
const p = fn();
p.finally(() => (isResolved = true));