Skip to content

Instantly share code, notes, and snippets.

# 1 - A Mermaid Diagram
This is an example of a prompt to the LLM which resulted in a code block which represents code for a simple diagram. Without knowing the mermaid language, you can ask the LLM to build a diagram for inclusion in your publication. We've shared the result of a prompt in this document for your reference in the "Example" section. Try your own prompt in the "#Try it yourself" section.
With this file `1-mermaid-diagrams.smd` open in our VSCode plugin, you can click the "Run" button and it will re-run the prompt agains an LLM. This will result in a new version of the diadram being drawn. It may look a little bit different than the one you saw when you first opened the document.
## Example
::: create a mermaid horizontal diagram with rectangular boxes of four major steps in the process of photosynthesis >>>
# Define the source directory and get all .md files
SRC_DIR := .
MD_FILES := $(wildcard $(SRC_DIR)/*.md)
# Define the output files for option1 and option2
PANDOC_FILES := $(patsubst %.md,%-pandoc.docx,$(MD_FILES))
STENCILA_FILES := $(patsubst %.md,%-stencila.docx,$(MD_FILES))
all: pandoc stencila
---
layout: bootcamp
root: .
venue: Euphoric State University
address: 123 College Street, Euphoria
country: United-States
humandate: Feb 17-18, 2020
humantime: 9:00 am - 4:30 pm
startdate: 2020-06-17
enddate: 2020-06-18
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
{
"cache": {"name": "Disk", "path": "/var/cache/tilestache/"},
"layers":
{
"unqc_cref_20140102.000000":
{
"projection": "spherical mercator",
"provider": { "name": "mapnik", "mapfile": "unqc_cref_mapnik.xml" },
"preview": { "lat": 49.0, "lon": -107.0, "zoom": 5, "ext": "png"}
@jduckles
jduckles / phenocam.sh
Last active June 27, 2024 13:18
This is a little script to check a phenocam site and determine if it has enough photos.
#!/bin/bash
PHENOCAM_DIR=/data/eomfftp/phenocam
SITES="Marena Elreno_iGOS_East Elreno"
CONTACT=jduckles@ou.edu
check_phenocam() {
SITE=$1
COUNT_DATE=$(ls $PHENOCAM_DIR/$SITE | cut -f 2,3 -d "-" | sort -r | uniq -c | head -1 | sed 's/^ *//g')
@jduckles
jduckles / badges.csv
Created July 24, 2017 08:08
Badges compared by population
country title badge_count
US Software Carpentry Instructor 459
US Data Carpentry Instructor 251
CA Software Carpentry Instructor 108
GB Software Carpentry Instructor 93
AU Software Carpentry Instructor 78
CA Data Carpentry Instructor 55
GB Data Carpentry Instructor 41
NZ Software Carpentry Instructor 37
AU Data Carpentry Instructor 30
#!/usr/bin/env python3
""" Fill SVG templates """
import sys
from svglib.svglib import svg2rlg
from reportlab.graphics import renderPDF
import jinja2
import pyaml
@jduckles
jduckles / build_software-carpentry.org.sh
Created August 8, 2017 21:24
Script used to build SWC website from GitHub
#!/bin/bash
set -e
SCRIPT='/home/data/sources/software-carpentry.org.sh'
LOG='/home/data/sources/software-carpentry.org.log'
DATE=`date`
echo '----------------' >> ${LOG}
echo ${DATE} >> ${LOG}
${SCRIPT} >> ${LOG} 2>&1
root@server-03:/home/data/cron_scripts# cat /home/data/sources/software-carpentry.org.sh
/article/27339/download/xml/
/article/26369/download/xml/
/article/25437/download/xml/
/article/26922/download/xml/
/article/26860/download/xml/
/article/26516/download/xml/
/article/26323/download/xml/
/article/26304/download/xml/
/article/26262/download/xml/
/article/26235/download/xml/