Public vals
86
yawnxyz
geminiBbox
HTTP
Gemini AI Object Detection and Bounding Box Visualizer This application visualizes object detection results by drawing bounding boxes on images using the Google's Gemini 1.5 Pro AI model . Try using this image of 8 bananas, with 1 row and 1/2/4 columns: https://f2.phage.directory/blogalog/bananas-8.png Or this image of a phage plaque assay, with 3x3 grid and high contrast turned on: https://f2.phage.directory/blogalog/pae7.png This app is an adaptation of Simon Willison's idea, which you can read more about here: https://simonwillison.net/2024/Aug/26/gemini-bounding-box-visualization/ API keys are only stored in your browser's local storage. Source code: https://www.val.town/v/yawnxyz/geminiBbox/ Original Source: https://github.com/simonw/tools/blob/main/gemini-bbox.html
0
yawnxyz
turnitdown
HTTP
HTML to Markdown Converter This is a simple web application that converts HTML to Markdown. It provides a clean and efficient way to transform HTML content into Markdown format, which is widely used for documentation and content creation. Features Easy-to-use Interface : Simple textarea inputs for HTML and Markdown output. Real-time Conversion : Converts HTML to Markdown instantly upon clicking the convert button. Clean Output : Removes scripts, styles, and other non-content elements from the HTML before conversion. Copy to Clipboard : One-click copying of the converted Markdown text. How It Works The application uses the Hono framework to create a simple web server. HTMX is used for handling AJAX requests without writing JavaScript. Alpine.js provides reactivity for the clipboard functionality. The Turndown library is used to convert HTML to Markdown. Usage Paste your HTML content into the "HTML Input" textarea. Click the "Convert to Markdown" button. The converted Markdown will appear in the "Markdown Output" textarea. Use the "Copy to Clipboard" button to easily copy the result. Technical Details The server removes <script> , <style> , and other non-content tags before conversion. HTML comments are also stripped out. The Markdown output is cleaned to remove excessive whitespace and newlines. View Source You can view the source code of this application by clicking the "View Source" link at the bottom of the page. Limitations The converter may not handle extremely complex HTML structures perfectly. Some HTML elements might not have a direct Markdown equivalent. Future Improvements Add options for customizing the Markdown output format. Implement file upload for HTML conversion. Add support for converting Markdown back to HTML. Feel free to use and modify this converter for your HTML to Markdown conversion needs!
0
yawnxyz
diesel
Script
Diesel Diesel is a lightweight data manipulation library inspired by Tom Wright's Dasel, designed for easy querying and transformation of various data formats such as JSON, YAML, CSV, and TOML. It allows users to select, update, and delete data using a simple selector syntax. Heavily adapted from https://github.com/TomWright/dasel Features Multi-format Support : Works with JSON, YAML, CSV, and TOML. Dynamic Selectors : Use conditions to filter data dynamically. Function Support : Built-in functions for data manipulation (e.g., length, sum, avg). Easy Integration : Can be used in both Deno and Val Town environments. Usage import Diesel from "https://esm.town/v/yawnxyz/diesel";
async function main() {
const jsonData = `
{
"users": [
{"id": 1, "name": "Alice", "age": 30},
{"id": 2, "name": "Bob", "age": 25},
{"id": 3, "name": "Charlie", "age": 35}
],
"settings": {
"theme": "dark",
"notifications": true
}
}
`;****
const diesel = new Diesel(jsonData, 'json');
try {
console.log("All data:", await diesel.select(''));
console.log("All users:", await diesel.select('users'));
console.log("First user's name:", await diesel.select('users.[0].name'));
console.log("Users over 30:", await diesel.select('users.(age>30)'));
await diesel.put('settings.theme', 'light');
console.log("Updated settings:", await diesel.select('settings'));
// await diesel.delete('users.[1]');
// console.log("Users after deletion:", await diesel.select('users'));
console.log("Data in YAML format:");
console.log(await diesel.convert('yaml'));
console.log("Data in TOML format:");
console.log(await diesel.convert('toml'));
console.log("Number of users:", await diesel.select('users.length()'));
console.log("User names in uppercase:", await diesel.select('users.[*].name.toUpper()'));
} catch (error) {
console.error("An error occurred:", error);
}
}
main(); Installation To use Diesel, simply import it in your Deno project as shown in the usage example. License This project is licensed under the MIT License.
0