Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
# frozen_string_literal: true
# Check JavaScript manifests/lockfiles for Wiz "Shai Hulud 2.0" compromised
# packages.
#
# Fetches the official package list from Wiz's public IOC repo and scans every
# `pnpm-lock.yaml`, `yarn.lock`, `package-lock.json`, `npm-shrinkwrap.json`, and
# `package.json` under the repository. Reports any compromised packages found
# along with the manifest/lockfile path.
@SamSaffron
SamSaffron / test.rb
Created November 10, 2025 00:02
env_lookup.rb
# frozen_string_literal: true
require "benchmark"
require "memory_profiler"
require "active_support"
require "active_support/core_ext/object/blank"
def test_fast
@cache = ENV["TESTING"].presence if !defined?(@cache)
@cache
end
#!/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
],