Skip to content

Instantly share code, notes, and snippets.

const fs = require("fs");
const path = require("path");
const yaml = require("js-yaml");
function extractEntitiesAndRelationships(baseDir) {
const entities = [];
function processFile(filePath) {
const fileContent = fs.readFileSync(filePath, "utf8");
const data = yaml.load(fileContent);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smith
smith / all.mermaid
Created March 25, 2025 02:37
OpenTelemetry data model visualizations
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smith
smith / entities.mermaid
Last active March 11, 2025 22:26
OpenTelemetry entities diagram
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smith
smith / newYearsDay.js
Created December 31, 2024 16:53
Solution to @cassidoo's interview question of the week 2024-12-30
// Interview question of the week (see https://buttondown.com/cassidoo/archive/we-must-adjust-to-changing-times-and-still-hold/)
// ...
//
// This week's question:
// Given a year, return the day of the week for New Year's Day of that year.
//
// Example:
//
// > newYearsDay(2025)
// > "Wednesday"
@smith
smith / import.sh
Last active July 1, 2024 13:30
The least complicated way to import a CSV into Elasticsearch
#!/bin/bash
# The simplest possible way to import a CSV into Elasticsearch without having to use a UI or depending on an Elasticsearch client library.
#
# Set $INDEX (the index name to import to) and $URL (the _bulk endpoint URL) environment variables.
#
# Requires `bash`, `awk`, `curl`, and [`mlr`](https://miller.readthedocs.io/en/6.12.0/) (for converting CSV to JSON.)
#
# Usage: sh ./import.sh < filename.csv
@smith
smith / notes.md
Created July 29, 2023 00:44
NeXTStation restoration notes

NeXTStation

Model N1100. Bought around 2000-2001 from UI Surplus.

See other documents in ../../NeXTStation.

There's an upgrade manual on the shelf in my office by the laptops. There's another manual I own but not sure where it is.

RAM was upgraded to 32MB, which is the max.

@smith
smith / chat log
Last active March 23, 2023 19:47
Chatting with bing about a bing bug
Set tone of responsesPreview
More
Creative
More
Balanced
More
{
"type": "object",
"required": ["name", "description", "identity", "trigraphs"],
"description": "JSON schema for https://spellcaster.sh",
"properties": {
"name": {
"type": "string",
"description": "represents an intent, desired state, or outcome."
},
"description": {