Skip to content

Instantly share code, notes, and snippets.

@cpopell
cpopell / json_to_sentences.js
Created May 19, 2025 20:07
Basic Agentic Propositional Flattening + cross-delimeter cosine comparison
import axios from 'axios';
import { config } from 'dotenv';
config();
/**
* Converts a JSON entity object into a list of sentence objects with JSON paths
* @param {Object} entity - The JSON entity to convert
* @param {string} [entityNameOverride] - Optional override for the entity name
* @returns {Array<{sentence: string, jsonPath: string}>} - Array of sentence objects
*/
@cpopell
cpopell / tavily-kosher-hotdogs.js
Created May 16, 2025 05:05
Agents and Kosher Hotdogs
const axios = require('axios');
const Anthropic = require('@anthropic-ai/sdk');
require("dotenv").config();
// API Key (replace with your actual key or set in .env)
const TAVILY_API_KEY = process.env.TAVILY_API_KEY || 'YOURKEYHERE';
// Configure logging
const DEBUG = true; // Set to false in production
function log(message, data = null) {
We can't make this file beautiful and searchable because it's too large.
address,categories,city,country,latitude,longitude,name,postalCode,province,reviews.date,reviews.dateAdded,reviews.doRecommend,reviews.id,reviews.rating,reviews.text,reviews.title,reviews.userCity,reviews.username,reviews.userProvince
Riviera San Nicol 11/a,Hotels,Mableton,US,45.421611,12.376187,Hotel Russo Palace,30126,GA,2013-09-22T00:00:00Z,2016-10-24T00:00:25Z,,,4,Pleasant 10 min walk along the sea front to the Water Bus. restaurants etc. Hotel was comfortable breakfast was good - quite a variety. Room aircon didn't work very well. Take mosquito repelant!,Good location away from the crouds,,Russ (kent),
Riviera San Nicol 11/a,Hotels,Mableton,US,45.421611,12.376187,Hotel Russo Palace,30126,GA,2015-04-03T00:00:00Z,2016-10-24T00:00:25Z,,,5,Really lovely hotel. Stayed on the very top floor and were surprised by a Jacuzzi bath we didn't know we were getting! Staff were friendly and helpful and the included breakfast was great! Great location and great value for money. Didn't want to leave!,Great hotel with Jac
{
"documents": [
{
"id": "1",
"text": "This document is in English."
},
{
"id": "2",
"text": "Este documento está en inglés."
},
@cpopell
cpopell / index.html
Last active April 9, 2016 22:35 — forked from d3noob/.block
Sankey from csv with d3.js
<!DOCTYPE html>
<meta charset="utf-8">
<title>SANKEY Experiment</title>
<style>
.node rect {
cursor: move;
fill-opacity: .9;
shape-rendering: crispEdges;
}
@cpopell
cpopell / index.html
Last active April 9, 2016 06:19 — forked from d3noob/.block
Sankey diagram with horizontal and vertical node movement
<!DOCTYPE html>
<meta charset="utf-8">
<title>SANKEY Experiment</title>
<style>
.node rect {
cursor: move;
fill-opacity: .9;
shape-rendering: crispEdges;
}
@cpopell
cpopell / index.html
Last active April 9, 2016 05:58 — forked from cfergus/index.html
Randomly generated sankey data. To show 'lane based' cycle rendering.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://d3js.org/d3.v2.js"></script>
<script type="text/javascript" src="./sankey.js"></script>
<title>Sankey Diagram</title>
<style>