Exported on 6/15/2025 at 18:07:29 GMT+9 from Cursor (1.1.2)
User
ugh my tests were hanging so i rebooted and now pg won't connect
psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
Exported on 6/12/2025 at 16:19:24 GMT+9 from Cursor (1.0.0)
User
Explain how KameSame does synonym detection when a user answers a question with a valid response but not the one we're looking for. can you please produce a report explaining this at a conceptual level and then back it up with progressively deeper technical dives?
I remember that while this is driven through the UI, it runs all the way down to the design of the database views, which i believe i even materialized for speed so that every night when the dictionaries are updated the synonym query is faster. i'll need you to check me on that stuff though b/c it's been 6+ years since i did this. provide receipts!
class Platforms::Bsky::AssemblesRichTextFacets | |
# Name of the game here is to take something output by IdentifiesPatternRanges | |
# (which exists to identify unbreakable tokens) and use the embedded metadata | |
# about which of these things are hashtags and links to construct the rich text | |
# facet hash that bluesky wants in order to render links and hashtags | |
def assemble(pattern_ranges) | |
pattern_ranges.map { |range| | |
if range[:type] == :tag | |
facet_for_tag(range) | |
elsif range[:type] == :link |
class Platforms::TruncatesContent::IdentifiesPatternRanges | |
HASHTAG_PATTERN = /\B#\p{L}[\p{L}\p{M}\p{Nd}_]*/ | |
# Ripped outta this https://github.com/amogil/url_regex/blob/master/lib/url_regex.rb | |
URL_PATTERN_STRING = ' | |
# scheme | |
(?:(?:https?|ftp)://)? | |
# user:pass authentication | |
(?:\S+(?::\S*)?@)? |
#!/bin/bash | |
# Ensure fswatch is installed | |
if ! command -v fswatch &> /dev/null; then | |
echo "Installing fswatch with Homebrew..." | |
brew install fswatch | |
exit 1 | |
fi | |
# Ensure Caddy is installed for serving files |
import { Controller } from '@hotwired/stimulus' | |
const BANNED_NODES = ['com-1password-button', 'com-1password-menu'] | |
export default class extends Controller { | |
connect () { | |
this.observer = new window.MutationObserver(mutations => { | |
mutations.forEach(mutation => { | |
mutation.addedNodes.forEach(node => { | |
if (BANNED_NODES.includes(node.nodeName.toLowerCase())) { | |
node.remove() |
# If you have any session variables that should survive a logout, add them to | |
# the except_for array. Usage from a controller: | |
# | |
# ResetsSessionButItsStillThursdayINeedThese.new.reset(self, | |
# except_for: [:has_logged_in_before]) | |
class ResetsSessionButItsStillThursdayINeedThese | |
def reset(receiver, except_for: []) | |
backup = except_for.map { |key| [key, receiver.session[key]] } | |
receiver.reset_session |
require "faker" | |
def lorem_paragraphs | |
rand(2..4).times.map { | |
rand(4..6).times.map { | |
Faker::Lorem.sentence(word_count: rand(10..40)) | |
}.join(" ") | |
}.join("\n\n") | |
end |
class TailwindClassBuilder | |
include ActionView::Helpers::TagHelper | |
def button_classes(options) | |
button_type = options.delete(:button_type) { :button } | |
class_names( | |
# general classes | |
"mt-4 px-1 sm:px-3 py-sm sm:py-1 font-semibold bg-transparent border rounded", | |
case button_type |
# This is a stupid utility to squelch stdout output via puts (could do the same | |
# for warn; could also override stdout entirely) | |
# | |
# Usage in a test, after requiring and including it: | |
# | |
# setup do | |
# suppress_puts([ | |
# /Execution context was destroyed, most likely because of a navigation/ | |
# ]) | |
# end |