Skip to content

Instantly share code, notes, and snippets.

# 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")
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Reflection.Emit;
using System.Collections.Concurrent;
using System.Data;
using System.Reflection;
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"
plugin_dir = File.expand_path("~/Source/discourse/plugins")
disabled_plugin_dir = File.expand_path("~/Source/discourse-plugins")
Curses.init_screen
Curses.noecho
#!/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")
@SamSaffron
SamSaffron / gist:101357
Created April 24, 2009 21:51
Control Vlc
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using Microsoft.Win32;
using System.Runtime.InteropServices;
using System.Management;
using System.Net.Sockets;
using System.IO;
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_