Skip to content

Instantly share code, notes, and snippets.

@nhoag
Created April 3, 2022 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nhoag/7b4b10130119ce080f80e2edec0acb73 to your computer and use it in GitHub Desktop.
Save nhoag/7b4b10130119ce080f80e2edec0acb73 to your computer and use it in GitHub Desktop.
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