This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 >>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Frigate Notification | |
description: | | |
## Frigate Mobile App Notification | |
This blueprint will send a notification to your device when a Frigate event for the selected camera is fired. The notification will initially include the thumbnail of the detection, but will update to include actionable notifications allowing you to view the saved clip/snapshot when available, or silence the notification for a configurable amount of time. | |
With this blueprint, you may send the notification to multiple devices by leaving "Device" blank and instead use a [notification group][1]. | |
### Required entities: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Make a PDF look scanned. | |
# Extracted from https://github.com/baicunko/scanyourpdf and modified for smaller output files (compression lower density). | |
INPUT_FILE=$1 | |
/usr/local/bin/convert -density '80' ${INPUT_FILE} -colorspace 'gray' -linear-stretch '3.5%x10%' \ | |
-blur '0x0.5' -attenuate '0.25' +noise Gaussian -rotate 0.5 \ | |
-compress lzw -quality 50 scanned_${INPUT_FILE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Python Script to pull down title of web page and enter it into a markdown snippet. | |
~/bin/url2mdlink.py %clipboard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for i in $(cat list_of_items.txt); do | |
# This echoes out each item | |
echo $i; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The website is itself a Git repo | |
git clone https://github.com/datacarpentry/datacarpentry.github.io | |
# enter the directory after we clone the repo | |
cd datacarpentry.github.io | |
# enter the directory where posts are, posts are text in Markdown | |
cd _posts | |
# Lets look (using grep) for the line in all posts that contains the "Subheadline" | |
# subheadline seems to be used to flag posts including community elements | |
grep -r "subheadline:" * |grep -i community | |
# grep -r looks recursively through directories, and grep -i makes the match case-insensitive (ie. community = CommunIty) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(jsonlite) | |
# Look for manifest in bucket "example-public-bucket" | |
data_manifest <- as_tibble(fromJSON("https://abacusworkflows.blob.core.windows.net/example-public-bucket/manifest.json")) | |
# Select down from manifest to just records with shortname "nz_stats_livestock" | |
livestock_record <- data_manifest %>% filter(shortname == "nz_stats_livestock") | |
# Open first file of nz_stats_livestock record | |
livestock_data <- read_csv(livestock_record$files[[1]]) | |
# Cleanup dates | |
livestock_data <- livestock_data %>% mutate(Year = as.numeric(str_remove_all(Year, "As at June 30 "))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from struct import pack, unpack #Some unpacking for the WAV encoding | |
from FFT import * #Some FFT goodness | |
from Numeric import * #Gotta have speedy math | |
import wave #For opening WAV files | |
from pylab import * #For ploting | |
from matplotlib.widgets import Slider, Button, RadioButtons | |
import os | |
from time import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mydata1 <- data.frame(letter = c("a","b","c","a","b","c")) | |
mydata2 <- data.frame(letter = c("a","b","c","a","b","c","a","b","a")) | |
stuff <- list(mydata1,mydata2) | |
myawesome <- function(df) { | |
levels <- c("a","b","c") | |
as.factor(df$letter) | |
} |
NewerOlder