Skip to content

Instantly share code, notes, and snippets.

@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,
#!/usr/bin/env ruby
require "curses"
require "fileutils"
require "open-uri"
require "shellwords"
plugin_dir = File.expand_path("~/Source/discourse/plugins")
disabled_plugin_dir = File.expand_path("~/Source/discourse-plugins")
title:
The name of this site. Visible to all visitors including anonymous users.
------
The name of the community or site as displayed on browsers' title bars, in emails, and across various areas of the site. This name is also publicly visible to all users including guests.
site_description:
Describe this site in one sentence. Visible to all visitors including anonymous users.
------
Provide a concise summary of your site's purpose that will be visible to everyone, including those who are not logged in.
require "net/http"
require "uri"
require "json"
require "yaml"
require "open3"
DISCOURSE_ROOT = "/home/sam/Source/discourse"
API_KEY = ENV["OPENAI_API_KEY"]
def openai_chat_completion(system_prompt, prompt)
#!/usr/bin/env ruby
require "curses"
require "fileutils"
require "open-uri"
require "shellwords"
plugin_dir = File.expand_path("~/Source/discourse/plugins")
disabled_plugin_dir = File.expand_path("~/Source/discourse-plugins")
notifications(topic_id,created_at,updated_at,post_action_id,id,data,high_priority,read,user_id,notification_type,post_number)
posts(raw_email,reply_to_user_id,created_at,percent_rank,raw,hidden_reason_id,spam_count,user_id,via_email,image_upload_id,word_count,illegal_count,like_count,hidden_at,baked_version,deleted_by_id,id,baked_at,inappropriate_count,quote_count,wiki,reads,bookmark_count,post_type,post_number,last_editor_id,version,cooked,like_score,incoming_link_count,off_topic_count,last_version_at,user_deleted,action_code,edit_reason,self_edits,notify_user_count,reply_quoted,score,topic_id,reply_to_post_number,notify_moderators_count,deleted_at,reply_count,updated_at,public_version,locked_by_id,outbound_message_id,hidden,cook_method,sort_order)
topics(deleted_by_id,views,last_post_user_id,fancy_title,highest_post_number,pinned_at,closed,last_posted_at,featured_link,percent_rank,updated_at,has_summary,featured_user2_id,score,external_id,moderator_posts_count,bannered_until,deleted_at,reply_count,featured_