Skip to content

Instantly share code, notes, and snippets.

@nhoag
Created Apr 3, 2022
Embed
What would you like to do?
Hello World Emacs org-mode runbook

Hello World

This is a hello world notebook.

To execute any of the code blocks, place the cursor in the block and type CTRL-C CTRL-C.

Hello World Setup

The below code block adds shell execution capability to the org babel session (default is emacs-lisp only). This block has been added as a dependency for subsequent code blocks.

(org-babel-do-load-languages
 'org-babel-load-languages
 '((shell . t)))

Hello World Shell

The below code block prints the current Unix timestamp.

date +%s

Hello World REST

The below code block executes a cURL command to convert the current Unix timestamp (from the above code block) to a date-time via a public API (contrived, but useful as a demonstration).

curl "https://showcase.api.linx.twenty57.net/UnixTime/fromunix?timestamp=$shellstamp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment