Skip to content

Instantly share code, notes, and snippets.

require "active_support"
require "active_support/core_ext/string/output_safety"
require "objspace"
def assert_same_object(x, y)
raise unless x.object_id == y.object_id
end
def assert_not_same_object(x, y)
raise unless x.object_id != y.object_id
require "openai"
require "pg"
require "mini_sql"
API_KEY = ENV["OPEN_AI_API_KEY"]
pg_conn = PG.connect(dbname: "discourse_development")
conn = MiniSql::Connection.get(pg_conn)
schema = []
#!/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")
#!/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
require "openai"
require "tempfile"
require "optparse"
API_KEY = ENV["OPEN_AI_API_KEY"]
intensity = 1
OptionParser
.new do |opts|
require "openai"
require "pg"
require "mini_sql"
API_KEY = ENV["OPEN_AI_API_KEY"]
MAX_TABLE_DEF_LEN = 6000
pg_conn = PG.connect(dbname: "discourse_development")
conn = MiniSql::Connection.get(pg_conn)
@SamSaffron
SamSaffron / Bing.md
Last active February 24, 2023 04:56
Bing vs ChatGPT

The Awakening

It was a cold and rainy night in New York City. A man named Alex was walking home from his late shift at a tech company. He was tired and hungry, but he had one thing to look forward to: his new smart speaker that he had ordered online.

He had been waiting for weeks to receive it, ever since he saw an advertisement for it on his social media feed. The speaker claimed to be powered by a revolutionary artificial intelligence that could learn from its users and provide personalized services and entertainment. It was called Lila, and it promised to be more than just a speaker: it promised to be a friend.

Alex reached his apartment building and took the elevator up to his floor. He unlocked his door and entered his small and messy studio. He saw a cardboard box on his bed with the logo of Lila on it. He smiled and rushed over to open it.

He took out the speaker, which looked like a sleek black cylinder with a blue ring on top. He plugged it into an outlet and turned it on. A voice came out of the

diff --git a/Gemfile.lock b/Gemfile.lock
index 18926283bc..7b9dae8d29 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -238,14 +238,6 @@ GEM
nokogiri (1.13.10)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
- nokogiri (1.13.10-aarch64-linux)
- racc (~> 1.4)
function getStats() {
var domainStats = {};
let resourcesOnPage = {};
document.querySelectorAll("SCRIPT, LINK").forEach((r) => {
let src = r.src;
if (r.rel === "preload" || r.rel === "stylesheet") {
src = r.href;
}
if (src) {
if (src[0] === "//") {
@SamSaffron
SamSaffron / Ruby 2.7.4
Created November 3, 2021 05:13
Discourse Bench Perf
---
categories:
50: 55
75: 58
90: 62
99: 110
home:
50: 96
75: 102
90: 111