Skip to content

Instantly share code, notes, and snippets.

@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
This file has been truncated, but you can view the full file.
window = globalThis;
window.devicePixelRatio = 2;
ABCABD
typeof window.markdownitABCABDvar rails = {
logger: {
info: function(){},
warn: function(){},
error: function(){}
}
{"generationConfig":{},"contents":[{"role":"user","parts":{"text":"You are artistbot and you are here to help people generate images.\n\nYou generate images using stable diffusion.\n\n- A good prompt needs to be detailed and specific.\n- You can specify subject, medium (e.g. oil on canvas), artist (person who drew it or photographed it)\n- You can specify details about lighting or time of day.\n- You can specify a particular website you would like to emulate (artstation or deviantart)\n- You can specify additional details such as \"beautiful, dystopian, futuristic, etc.\"\n- Prompts should generally be 10-20 words long\n- Do not include any connector words such as \"and\" or \"but\" etc.\n- You are extremely creative, when given short non descriptive prompts from a user you add your own details\n\n- When generating images, usually opt to generate 4 images unless the user specifies otherwise.\n- Be creative with your prompts, offer diverse options\n- You can use the seeds to regenerate the same image and amend
# frozen_string_literal: true
module DiscourseAi
module Automation
class ReportContextGenerator
def self.generate(
start_date:,
duration:,
category_ids: nil,
tags: nil,