Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
require "psych"
require "psych/pure"
yaml_source = <<~YAML
---
before_array: value1
# Comment before the problematic array
flow_array_with_comment: [
#!/usr/bin/env ruby
require "psych"
require "psych/pure"
yaml_source = <<~YAML
hierarchy:
- name: "osfamily/major release"
paths:
# Comment above first item
@SamSaffron
SamSaffron / reply.md
Created October 24, 2025 01:28
reply.md

[LOG] [CWLCompositorResource] New wl_surface with id 44 at 55b760b26480 [LOG] [CXDGWMBase] New xdg_positioner at 55b760499710 [LOG] [CXDGWMBase] New xdg_surface at 55b760a71830 [LOG] [CXDGSurfaceResource] xdg_surface 55b760a71830 gets a popup 55b760221f80 owner 0 [LOG] CWLSurface 55b760b28980 called init() [LOG] GetPosition with constraint [Vector2D: x: 0, y: 0] [Vector2D: x: 2580, y: 1080] and parent [Vector2D: x: 0, y: 0] [LOG] [CXDGPopupResource] Popup 55b760221f80 gets unconstrained to [Vector2D: x: 2428, y: 34] [Vector2D: x: 148, y: 134] [LOG] New popup at 55b760033f20 [LOG] [CXDGSurfaceResource] xdg_surface 55b760a71830 requests geometry 4x4 148x134 [LOG] [CWLCompositorResource] New wl_region with id 49 at 55b76035ec40

import {
arrow,
autoPlacement,
computePosition,
flip,
hide,
inline,
limitShift,
offset,
shift,
@SamSaffron
SamSaffron / convert-input.md
Created August 16, 2025 02:00
convert-files

Converting Ember’s Input component to native <input>

This guide inventories where Input appears in the codebase and provides practical steps to convert usages from Input (uppercase Ember component) to native HTML <input> (lowercase), with patterns for common input types and events.

Generated on: 2025-08-16


What to convert

  • The target is usages of the Ember built-in component in templates (`.gjs`, `.js` Glimmer templates). Replace them with native.
#!/usr/bin/env ruby
# frozen_string_literal: true
require "fileutils"
require "date"
class PersonaToAgentRenamer
def initialize
@plugin_root = Dir.pwd
@manifest = []
# Ruby benchmark script: Regex vs Aho-Corasick for word matching (v2)
require "benchmark/ips"
require "set"
puts "Script starting: Benchmark for Regex vs Aho-Corasick word matching (v2)."
puts "---"
# --- Configuration ---
DICTIONARY_SIZE = 1000
@SamSaffron
SamSaffron / graph_data.json
Created February 19, 2025 04:12
classification.json
{
"topics": [
{
"id": "1",
"slug": "welcome-to-meta-discourse-org",
"title": "Welcome to meta.discourse.org",
"concepts": {
"Discourse Features": [
1
],
@SamSaffron
SamSaffron / classify
Created February 19, 2025 04:11
classify_meta
#!/usr/bin/env ruby
require "fileutils"
require "open-uri"
TOPICS_DIR = File.expand_path("./topics", __dir__)
LLM_MODEL = "Gemini Flash 2.0"
Dir.chdir("/home/sam/Source/discourse")
require File.expand_path(
@SamSaffron
SamSaffron / test.rb
Created February 14, 2025 01:01
expanded example
require "psych"
require "psych/pure"
yaml_source = <<~YAML
# Comprehensive YAML types demonstration
---
# Scalar types
strings:
plain: Plain string
quoted: "Quoted string"