Skip to content

Instantly share code, notes, and snippets.

I’m currently using Org-roam to facilitate most new note creation.

Org-roam has a concept of “daily” files. I consider these are collections of nodes that the target location (especially the filename, at least in my case) based on the date.

I use dailies (org-roam-capture-today) for:

  • Recurring meeting notes
    • Daily stand-ups
    • Customer meetings
@nickanderson
nickanderson / example.org
Created November 8, 2022 14:30
Example illustrating munging YAML data structure into a list of strings

Example illustrating munging YAML data structure into a list of strings

bundle agent main
{
  vars:
      "yaml" data => parseyaml ('
  books:
    scifi_schema:
      isbn: "isbn_scifi"
@nickanderson
nickanderson / example.org
Created November 7, 2022 15:00
Work with yaml and output in specific format

Use the YAML to generate output matching the following format:

scifi::isbn: 'isbn' with book_name: 'book_name'
travel::isbn: 'isbn' with book_name: 'book_name'

Policy:


@nickanderson
nickanderson / example.org
Created October 27, 2022 16:21
Example expanding interface name in classic cfengine template for Sparky in #cfengine on irc.libera.chat
### Managed by CFEngine
$(sys.ipv4) is on $(sys.ip2iface[$(sys.ipv4)])
bundle agent __main__
{
@nickanderson
nickanderson / cfengine-example-strip-suffixes-from-a-list.org
Created October 7, 2022 22:13
A few different ways of stripping suffixes from a list of filenames, asked about in IRC.

Here are a few different ways to take "numbered" slist => {'1.txt','2.txt','3.txt'}; and get a list where .txt is stripped from each element.

bundle agent __main__
{

  vars:

      "numbered" slist => {'1.txt','2.txt','3.txt'};

Example illustrating methods-inherit

bundle agent __main__
{
  methods:
      "parent";

}
bundle agent parent
@nickanderson
nickanderson / classes-inherit.org
Created October 3, 2022 19:12
How to inherit bundle scoped classes
bundle agent main
{
    methods: "guac";
}
bundle agent guac
{
    classes:
      "tomcat" expression => "guacamole";
@nickanderson
nickanderson / example.org
Last active September 22, 2022 19:23
Example for Michael2
bundle agent __main__
{
  vars:
      # Using in-line yaml
      "my_yaml" data => parseyaml('
mykey: myvalue
domain:
  name: example.com
@nickanderson
nickanderson / example.org
Created August 16, 2022 14:37
Example iterating over list of urls and checking return code of url_get
bundle agent __main__
{
  methods:
      "example_down_detector";
}
bundle agent example_down_detector
{
  vars:

this.promiser does work in files promises. but not necessarily EVERYWHERE, so where it does not work you need to open a ticket. It’s really helpful if you provide standalone examples illustrating specific places it does not work, and better yet if they come in the form of an acceptance test.

bundle agent __main__
{
  files:
    "/tmp/test0.txt" content => "Goodbye";