Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased]

### Added

- **Seven recipes built on run on each**: turn a `.env` file into a Kubernetes Secret; convert Unix timestamps
in a JSON response to dates; decode every JWT in a log, HAR file or curl trace; remove tracking parameters
from a list of URLs; hash an email list with SHA-256 for Customer Match; extract the domain from each URL in
a list; parse the user agents of an access log into a CSV.

### Changed

- Recipe pages show what runs inside a run-on-each or branch step: every nested step with its link, the
Expand Down
130 changes: 130 additions & 0 deletions src/recipes/_generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,24 @@ export const RECIPE_INDEX: RecipeMeta[] = [
"stepCount": 6,
"published": "2026-10-07"
},
{
"slug": "convert-unix-timestamps-in-json",
"name": "Convert Unix timestamps in a JSON response to dates",
"summary": "Paste an API response and get the same JSON back with its epoch seconds and milliseconds turned into ISO 8601 dates at any depth, while small ids, prices and phone numbers stay as they are.",
"category": "Web & APIs",
"utilityIds": [
"json_flatten",
"json_unflatten",
"timestamp_convert"
],
"chain": [
"flatten to paths",
"convert epoch values",
"rebuild the JSON"
],
"stepCount": 3,
"published": "2026-10-08"
},
{
"slug": "decode-cloudwatch-logs-data",
"name": "Decode CloudWatch Logs subscription data",
Expand Down Expand Up @@ -116,6 +134,25 @@ export const RECIPE_INDEX: RecipeMeta[] = [
"stepCount": 5,
"published": "2026-10-07"
},
{
"slug": "decode-jwts-in-log-file",
"name": "Decode every JWT in a log or HAR file",
"summary": "Paste a log, a HAR export or a curl -v trace and read the claims of every JSON Web Token in it, each once, with iat, exp and auth_time shown as dates instead of epoch seconds.",
"category": "Web & APIs",
"utilityIds": [
"extract_preset",
"jsonl_to_json",
"jwt_decode",
"timestamp_convert"
],
"chain": [
"find every token",
"decode each token",
"one JSON array"
],
"stepCount": 3,
"published": "2026-10-08"
},
{
"slug": "decode-kubernetes-secret",
"name": "Decode a Kubernetes Secret",
Expand Down Expand Up @@ -156,6 +193,26 @@ export const RECIPE_INDEX: RecipeMeta[] = [
"stepCount": 5,
"published": "2026-10-07"
},
{
"slug": "env-file-to-kubernetes-secret",
"name": "Turn a .env file into a Kubernetes Secret",
"summary": "Paste a .env file and get a Secret manifest with every value Base64-encoded under data, ready for kubectl apply, with quotes, export prefixes, comments and multi-line values handled.",
"category": "DevOps & Config",
"utilityIds": [
"base64_encode",
"env_to_json",
"json_to_yaml",
"replace"
],
"chain": [
"parse the .env file",
"encode every value",
"wrap in a Secret",
"json to yaml"
],
"stepCount": 4,
"published": "2026-10-08"
},
{
"slug": "excel-column-to-sql-in-clause",
"name": "Turn an Excel column into a SQL IN clause",
Expand All @@ -178,6 +235,24 @@ export const RECIPE_INDEX: RecipeMeta[] = [
"published": "2026-10-07",
"updated": "2026-10-08"
},
{
"slug": "extract-domains-from-urls",
"name": "Extract the domain from a list of URLs",
"summary": "Paste a column of links and get each one’s hostname on the same line, lowercased and without www., whether or not the link starts with https://, so it pastes back beside its URL.",
"category": "Data & Spreadsheets",
"utilityIds": [
"jsonpath",
"line_affix",
"replace",
"url_parse"
],
"chain": [
"hostname of every URL",
"drop www."
],
"stepCount": 2,
"published": "2026-10-08"
},
{
"slug": "fix-bash-bad-interpreter",
"name": "Fix ^M bad interpreter errors in a shell script",
Expand Down Expand Up @@ -221,6 +296,25 @@ export const RECIPE_INDEX: RecipeMeta[] = [
"stepCount": 6,
"published": "2026-10-07"
},
{
"slug": "hash-email-list-for-customer-match",
"name": "Hash an email list for Customer Match",
"summary": "Paste a column of customer emails and get one SHA-256 hash per line, normalized the way Google Ads Customer Match expects, with header and blank rows kept so rows still line up.",
"category": "Writing & Marketing",
"utilityIds": [
"case",
"hash",
"replace"
],
"chain": [
"remove spaces and quotes",
"change case",
"drop Gmail dots",
"SHA-256 every address"
],
"stepCount": 4,
"published": "2026-10-08"
},
{
"slug": "nested-json-to-csv",
"name": "Convert nested JSON to CSV",
Expand All @@ -239,6 +333,42 @@ export const RECIPE_INDEX: RecipeMeta[] = [
"stepCount": 3,
"published": "2026-10-07"
},
{
"slug": "parse-user-agents-from-access-log",
"name": "Parse user agents from an access log into a CSV",
"summary": "Paste nginx or Apache access log lines, or a column of user-agent strings, and get a CSV row per line with the browser, OS, device and a bot flag.",
"category": "Web & APIs",
"utilityIds": [
"json_to_csv",
"jsonl_to_json",
"replace",
"user_agent_parse"
],
"chain": [
"keep the user-agent field",
"parse every line",
"collect into an array",
"pick columns as CSV"
],
"stepCount": 4,
"published": "2026-10-08"
},
{
"slug": "remove-tracking-parameters-from-urls",
"name": "Remove tracking parameters from a list of URLs",
"summary": "Paste links one per line and get them back without utm_ tags, fbclid, gclid, srsltid and other click ids, with the parameters a page needs, the order and any #anchor kept.",
"category": "Writing & Marketing",
"utilityIds": [
"query_params_normalize",
"unescape_html"
],
"chain": [
"undo &",
"clean every link"
],
"stepCount": 2,
"published": "2026-10-08"
},
{
"slug": "spring-boot-yaml-to-env-vars",
"name": "Convert Spring Boot application.yml to environment variables",
Expand Down
7 changes: 7 additions & 0 deletions src/recipes/_generated/loaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,22 @@ import type { Recipe } from '../types'
export const RECIPE_LOADERS: Record<string, () => Promise<{ recipe: Recipe; guide: string }>> = {
"bulk-utm-link-builder": () => Promise.all([import('../bulk-utm-link-builder/recipe'), import('../bulk-utm-link-builder/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
"clean-chatgpt-text": () => Promise.all([import('../clean-chatgpt-text/recipe'), import('../clean-chatgpt-text/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
"convert-unix-timestamps-in-json": () => Promise.all([import('../convert-unix-timestamps-in-json/recipe'), import('../convert-unix-timestamps-in-json/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
"decode-cloudwatch-logs-data": () => Promise.all([import('../decode-cloudwatch-logs-data/recipe'), import('../decode-cloudwatch-logs-data/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
"decode-flask-session-cookie": () => Promise.all([import('../decode-flask-session-cookie/recipe'), import('../decode-flask-session-cookie/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
"decode-helm-release-secret": () => Promise.all([import('../decode-helm-release-secret/recipe'), import('../decode-helm-release-secret/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
"decode-jwts-in-log-file": () => Promise.all([import('../decode-jwts-in-log-file/recipe'), import('../decode-jwts-in-log-file/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
"decode-kubernetes-secret": () => Promise.all([import('../decode-kubernetes-secret/recipe'), import('../decode-kubernetes-secret/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
"decode-saml-request": () => Promise.all([import('../decode-saml-request/recipe'), import('../decode-saml-request/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
"env-file-to-kubernetes-secret": () => Promise.all([import('../env-file-to-kubernetes-secret/recipe'), import('../env-file-to-kubernetes-secret/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
"excel-column-to-sql-in-clause": () => Promise.all([import('../excel-column-to-sql-in-clause/recipe'), import('../excel-column-to-sql-in-clause/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
"extract-domains-from-urls": () => Promise.all([import('../extract-domains-from-urls/recipe'), import('../extract-domains-from-urls/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
"fix-bash-bad-interpreter": () => Promise.all([import('../fix-bash-bad-interpreter/recipe'), import('../fix-bash-bad-interpreter/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
"fix-pdf-line-breaks": () => Promise.all([import('../fix-pdf-line-breaks/recipe'), import('../fix-pdf-line-breaks/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
"hash-email-list-for-customer-match": () => Promise.all([import('../hash-email-list-for-customer-match/recipe'), import('../hash-email-list-for-customer-match/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
"nested-json-to-csv": () => Promise.all([import('../nested-json-to-csv/recipe'), import('../nested-json-to-csv/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
"parse-user-agents-from-access-log": () => Promise.all([import('../parse-user-agents-from-access-log/recipe'), import('../parse-user-agents-from-access-log/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
"remove-tracking-parameters-from-urls": () => Promise.all([import('../remove-tracking-parameters-from-urls/recipe'), import('../remove-tracking-parameters-from-urls/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
"spring-boot-yaml-to-env-vars": () => Promise.all([import('../spring-boot-yaml-to-env-vars/recipe'), import('../spring-boot-yaml-to-env-vars/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
"unescape-stringified-json": () => Promise.all([import('../unescape-stringified-json/recipe'), import('../unescape-stringified-json/guide.md?raw')]).then(([r, g]) => ({ recipe: r.default, guide: g.default })),
}
36 changes: 25 additions & 11 deletions src/recipes/_generated/static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,24 @@
import type { Recipe } from '../types'
import r0 from '../bulk-utm-link-builder/recipe'
import r1 from '../clean-chatgpt-text/recipe'
import r2 from '../decode-cloudwatch-logs-data/recipe'
import r3 from '../decode-flask-session-cookie/recipe'
import r4 from '../decode-helm-release-secret/recipe'
import r5 from '../decode-kubernetes-secret/recipe'
import r6 from '../decode-saml-request/recipe'
import r7 from '../excel-column-to-sql-in-clause/recipe'
import r8 from '../fix-bash-bad-interpreter/recipe'
import r9 from '../fix-pdf-line-breaks/recipe'
import r10 from '../nested-json-to-csv/recipe'
import r11 from '../spring-boot-yaml-to-env-vars/recipe'
import r12 from '../unescape-stringified-json/recipe'
import r2 from '../convert-unix-timestamps-in-json/recipe'
import r3 from '../decode-cloudwatch-logs-data/recipe'
import r4 from '../decode-flask-session-cookie/recipe'
import r5 from '../decode-helm-release-secret/recipe'
import r6 from '../decode-jwts-in-log-file/recipe'
import r7 from '../decode-kubernetes-secret/recipe'
import r8 from '../decode-saml-request/recipe'
import r9 from '../env-file-to-kubernetes-secret/recipe'
import r10 from '../excel-column-to-sql-in-clause/recipe'
import r11 from '../extract-domains-from-urls/recipe'
import r12 from '../fix-bash-bad-interpreter/recipe'
import r13 from '../fix-pdf-line-breaks/recipe'
import r14 from '../hash-email-list-for-customer-match/recipe'
import r15 from '../nested-json-to-csv/recipe'
import r16 from '../parse-user-agents-from-access-log/recipe'
import r17 from '../remove-tracking-parameters-from-urls/recipe'
import r18 from '../spring-boot-yaml-to-env-vars/recipe'
import r19 from '../unescape-stringified-json/recipe'

export const STATIC_RECIPES: Recipe[] = [
r0,
Expand All @@ -28,4 +35,11 @@ export const STATIC_RECIPES: Recipe[] = [
r10,
r11,
r12,
r13,
r14,
r15,
r16,
r17,
r18,
r19,
]
40 changes: 40 additions & 0 deletions src/recipes/convert-unix-timestamps-in-json/guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: Convert Unix Timestamps in JSON to Readable Dates
description: Paste an API response and turn every epoch seconds or milliseconds value into an ISO 8601 date at any depth, leaving the rest of the JSON as it was.
---

## Reading dates in an API response

Most APIs send dates as Unix time: `"created_at": 1790848800` in seconds, or `"ts": 1790848800123` in milliseconds. That is compact and unambiguous for code, and unreadable for a person comparing two orders or checking when a token expires. Converting them one at a time means copying each number into a converter and back, and a response with a page of fifty records has a hundred or more of them, at different depths and under different names.

A find-and-replace over the raw text cannot do it either, because the replacement is not fixed text: every number becomes a different date. This recipe keeps the JSON as JSON, finds every value that looks like a timestamp wherever it sits, converts it, and gives you the response back in its own shape.

## What each step does

[JSON flatten](/util/json_flatten/) turns the document into a single object of paths and values, such as `data[0].created_at` or `[2].ts` for a top-level array. That brings every value, however deeply nested, to the top level, where the next step can visit them one by one. Keys that contain dots or brackets are quoted in the path, so they survive the trip back.

The second step runs [timestamp convert](/util/timestamp_convert/) on each value on its own, set to ISO 8601 in UTC, but only when the value matches a pattern: 10 digits starting with 12 to 19 (seconds) or 13 digits starting the same way (milliseconds), with an optional fraction. Numbers written as strings, such as `"issued_at": "1790848800"`, match too. Everything else, including `null`, short numbers and text, passes through untouched. To see local time instead, change the timezone in step 2 to an IANA name such as `Europe/Paris`, which gives `2026-10-01T12:00:00.000+02:00`, or switch convert to to `sql` or `rfc2822` for those formats.

[JSON unflatten](/util/json_unflatten/) then rebuilds the nesting from the paths, in the original key order.

## What it can mistake for a date

The pattern looks only at the value, never at its key, so it covers the years 2008 to 2033: from 2008-01-10 (`1200000000`) to 2033-05-18 (`1999999999`). Anything else of that shape is converted too:

- money in micros, such as a Google Ads `costMicros` of `1500000000` for 1,500 in the account currency;
- byte counts between 1.2 and 2 GB;
- ids of 10 or 13 digits that start with 12 to 19, such as some Google Ads customer ids.

Dates outside that window stay numbers, and so do microseconds (16 digits) and nanoseconds (19 digits). Scan the output for fields that should not have turned into dates, and fix those by hand or leave them out of what you paste.

Integers larger than 2^53 (about 9 × 10^15) cannot be held exactly by JavaScript, so a 19-digit id comes back rounded, `1712345678901234567` as `1712345678901234700`. APIs that send such ids usually include a string copy (`id_str` and similar); read that one.

## Input it cannot read

The input has to be one JSON document. JSON Lines (one object per line), `curl -i` output with the HTTP headers on top, JSON with comments or trailing commas, and a Python dict printed with single quotes and `True` all stop at the first step with "invalid JSON". Copy only the body, or convert it first. A field whose value is a JSON document stored as a string keeps its timestamps unconverted: decode it with the [unescape stringified JSON](/recipes/unescape-stringified-json/) recipe, then run this one.

One run converts at most 100,000 values. A larger response stops at step 2 with a message saying how many it has: split it, or use jq.

## The same in jq

`jq 'walk(if type == "number" and . >= 1200000000 and . < 2000000000 then todate elif type == "number" and . >= 1200000000000 and . < 2000000000000 then (. / 1000 | todate) else . end)'` does the same for numbers, with no size limit, but drops the milliseconds and leaves timestamps written as strings alone.
Loading