Skip to content

Instantly share code, notes, and snippets.

@Impact123
Impact123 / Check Space.md
Last active May 5, 2025 15:47
Check Space

How to check HAOS space usage

The goal of this Article is to teach you how to find out what takes how much space on your HAOS system.
At the end of this article you should have an interactive way to explore your storage similar to this.
Animation

To check the recorder database size/stats I recommend the DBStats addon/container.

Table of contents

@dannguyen
dannguyen / README.openai-structured-output-demo.md
Last active April 28, 2025 03:31
A basic test of OpenAI's Structured Output feature against financial disclosure reports and a newspaper's police blotter. Code examples use the Python SDK and pydantic for the schema definition.

Extracting financial disclosure reports and police blotter narratives using OpenAI's Structured Output

tl;dr this demo shows how to call OpenAI's gpt-4o-mini model, provide it with URL of a screenshot of a document, and extract data that follows a schema you define. The results are pretty solid even with little effort in defining the data — and no effort doing data prep. OpenAI's API could be a cost-efficient tool for large scale data gathering projects involving public documents.

OpenAI announced Structured Outputs for its API, a feature that allows users to specify the fields and schema of extracted data, and guarantees that the JSON output will follow that specification.

For example, given a Congressional financial disclosure report, with assets defined in a table like this:

@MichaelCurrin
MichaelCurrin / README.md
Last active December 2, 2024 08:30
Render content for all Jekyll pages as a single JSON endpoint

Make a REST API with Jekyll

Render content for all your Jekyll pages as a single JSON endpoint

Usecase

You have the content of your site stored as Markdown pages, but you want to load each page as structured data. Such as for building a SPA (with React or Vue) or a mobile app.

How it works

@cmod
cmod / hugofastsearch.md
Last active April 17, 2025 23:32 — forked from eddiewebb/readme.md
Fast, instant client side search for Hugo static site generator
@squarism
squarism / multiline.exs
Last active March 25, 2024 15:27
Multiline Anonymous Functions in Elixir
# Examples of Different Styles and Syntax
# legal / positive case / you can do these stuffs
# ---------------------------------------------------------------------------
# single line, nothing special
Enum.map(0...2, fn i -> IO.puts i end)
"""
0
1
@maxivak
maxivak / webpacker_rails.md
Last active November 3, 2024 21:38
Webpack, Yarn, Npm in Rails
@getify
getify / 1.md
Last active October 15, 2020 01:44
BetterPromise: a strawman experiment in subclassing Promise and "fixing" a bunch of its awkward/bad parts

Some things that are "better" with this BetterPromise implementation:

  • BetterPromise # then(..) accepts a BetterPromise (or Promise) instance passed directly, instead of requiring a function to return it, so that the promise is linked into the chain.

    var p = BetterPromise.resolve(42);
    
    var q = Promise.resolve(10);
    
    p.then(console.log).then(q).then(console.log);
@grishgrigoryan
grishgrigoryan / IterableFile.ts
Created May 4, 2018 12:55
Helper to iterate over file in browser using for-await-of loop
interface IConfig{
chunkSize:number
}
class IterableFile implements AsyncIterable<string>{
private reader : FileReader;
private file:File
private config : IConfig = {chunkSize : 64 * 1024}
constructor( file:File,config :Partial<IConfig> = {}){
this.file = file