Skip to content

Instantly share code, notes, and snippets.

@SamSaffron
SamSaffron / graph_data.json
Created February 19, 2025 04:12
classification.json
{
"topics": [
{
"id": "1",
"slug": "welcome-to-meta-discourse-org",
"title": "Welcome to meta.discourse.org",
"concepts": {
"Discourse Features": [
1
],
@SamSaffron
SamSaffron / classify
Created February 19, 2025 04:11
classify_meta
#!/usr/bin/env ruby
require "fileutils"
require "open-uri"
TOPICS_DIR = File.expand_path("./topics", __dir__)
LLM_MODEL = "Gemini Flash 2.0"
Dir.chdir("/home/sam/Source/discourse")
require File.expand_path(
@SamSaffron
SamSaffron / test.rb
Created February 14, 2025 01:01
expanded example
require "psych"
require "psych/pure"
yaml_source = <<~YAML
# Comprehensive YAML types demonstration
---
# Scalar types
strings:
plain: Plain string
quoted: "Quoted string"
@SamSaffron
SamSaffron / demo.rb
Created February 13, 2025 00:06
psych_pure
require "psych"
require "psych/pure"
# Let's create a rich YAML document with various types and comments
yaml_source = <<~YAML
# Configuration for our awesome application
---
database: # Database settings
host: localhost # Can be changed for production
port: 5432 # Default PostgreSQL port
sam@arch evals % ./run -e simple_pdf
Running evaluation 'simple_pdf'
GPT-4o: Failed 🔴
---- Expected ----
(?-mix:Gandalf.*H0rTm1iI)
---- Actual ----
Here is a photo of a wizard:
[Description: An illustration of a wizard with a long white beard, wearing a pointed hat and holding a wooden staff. The wizard is in a mystical forest setting and is holding a sign that says "Gandalf."]
@SamSaffron
SamSaffron / public-sentiment2.json
Created February 3, 2025 04:04
public-sentiment
{"success":true,"errors":[],"duration":190.4,"result_count":1717,"params":null,"columns":["topic_id","title","post_id","post_number","username","post_excerpt","category_id","category_name","tag_names","positive_score","negative_score"],"default_limit":1000,"rows":[[348270,"Why are bubbles blinking around my avatar?",1692323,1,"hellekin","Why is my avatar blinking with orbital bubbles? I can't make it go. I tried dismissing all notifications, it's sticking there and making me crazy. Please remove this!\n\n\nI don't seem to have access to any meaningful chat channel either.",6,"Support","",0.0077483836,0.9240205],[349536,"Adjacent emoji sometimes doesn't render the 2nd emoji",1699113,5,"zogstrip","Closing as duplicate of https://meta.discourse.org/t/inline-emoji-turned-into-text/345300 which I'm already investigating but it's unfortunately not an easy fix :|",1,"Bug","emoji",0.006285333,0.90943927],[100673,"(deprecated) Plugin outlet locations theme component",1693901,41,"Monikas","## It's sad to see Theme comp
@SamSaffron
SamSaffron / sentiment.json
Created February 3, 2025 03:36
public_meta_sentiment.json
{"success":true,"errors":[],"duration":182.6,"result_count":1716,"params":null,"columns":["topic_id","title","post_id","post_number","category_id","category_name","tag_names","positive_score","negative_score"],"default_limit":1000,"rows":[[348270,"Why are bubbles blinking around my avatar?",1692323,1,6,"Support","",0.0077483836,0.9240205],[349536,"Adjacent emoji sometimes doesn't render the 2nd emoji",1699113,5,1,"Bug","emoji",0.006285333,0.90943927],[100673,"(deprecated) Plugin outlet locations theme component",1693901,41,120,"Theme component","end-of-life",0.0076029,0.9084436],[347278,"Issue while rebuilding",1691311,21,6,"Support","",0.00800424,0.90549976],[349444,"An error occurred: Body seems unclear, is it a complete sentence?",1697894,3,6,"Support","",0.00619437,0.8997855],[107971,"News Plugin :newspaper:",1700047,164,22,"Plugin","broken,pavilion",0.0051847114,0.8961053],[66097,"Show post numbers",1692537,6,2,"Feature","",0.005885868,0.8960039],[348855,"Discourse Self Hosting with Docker compose",16974
@SamSaffron
SamSaffron / graph_data.json
Created January 23, 2025 06:17
meta-topics.json
{
"topics": [
{
"id": "1",
"slug": "welcome-to-meta-discourse-org",
"title": "Welcome to meta.discourse.org",
"concepts": {
"Discourse Features": [
1
],
@SamSaffron
SamSaffron / LICENSE
Created December 27, 2024 04:27
testing
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
require 'concurrent'
puts "Thread Count: #{Thread.list.count}"
pool = Concurrent::CachedThreadPool.new( min_threads: 0, max_threads: 5, idletime: 1 )
puts "Thread Count: #{Thread.list.count}"
# we have 1 thread for now
5.times do