Skip to content

Instantly share code, notes, and snippets.

View Yegorov's full-sized avatar
🏢
Work it harder. Make it better. Do it faster.

Artem Yegorov

🏢
Work it harder. Make it better. Do it faster.
View GitHub Profile
@hackermondev
hackermondev / writeup.md
Last active December 29, 2025 10:29
How we pwned X (Twitter), Vercel, Cursor, Discord, and hundreds of companies through a supply-chain attack

hi, i'm daniel. i'm a 16-year-old high school senior. in my free time, i hack billion dollar companies and build cool stuff.

about a month ago, a couple of friends and I found serious critical vulnerabilities on Mintlify, an AI documentation platform used by some of the top companies in the world.

i found a critical cross-site scripting vulnerability that, if abused, would let an attacker to inject malicious scripts into the documentation of numerous companies and steal credentials from users with a single link open.

(go read my friends' writeups (after this one))
how to hack discord, vercel, and more with one easy trick (eva)
Redacted by Counsel: A supply chain postmortem (MDL)

The Unofficial 37signals/DHH Rails Style Guide

About This Document

This style guide was generated by Claude Code through deep analysis of the Fizzy codebase - 37signals' open-source project management tool.

Why Fizzy matters: While 37signals has long advocated for "vanilla Rails" and opinionated software design, their production codebases (Basecamp, HEY, etc.) have historically been closed source. Fizzy changes that. For the first time, developers can study a real 37signals/DHH-style Rails application - not just blog posts and conference talks, but actual production code with all its patterns, trade-offs, and deliberate omissions.

How this was created: Claude Code analyzed the entire codebase - routes, controllers, models, concerns, views, JavaScript, CSS, tests, and configuration. The goal was to extract not just what patterns are used, but why - inferring philosophy from implementation choices.

@clashnewbm3
clashnewbm3 / Code
Created August 26, 2025 11:06
Ruby Hacker Text Animation
print "\e[?25l"
rows, cols = `stty size`.split.map(&:to_i)
drops = Array.new(cols) { rand(rows) }
chars = ("0".."9").to_a + ("A".."Z").to_a + ("a".."z").to_a
loop do

name: tester description: Use this agent when you need to write RSpec tests for new functionality, including feature specs for user workflows and unit tests for models, services, or other classes. Examples: Context: User has just implemented a new authentication feature and needs comprehensive test coverage. user: 'I just added magic link authentication to the User model. Can you write tests for this?' assistant: 'I'll use the rspec-test-writer agent to create comprehensive tests for your magic link authentication feature.' Since the user needs RSpec tests written for new functionality, use the rspec-test-writer agent to create appropriate test coverage. Context: User has created a new controller action and wants to ensure it's properly tested. user: 'I added a new endpoint for project time tracking. Here's the controller code...' assistant: 'Let me use the rspec-test-writer agent to write feature specs and controller tests for your new time tracking en

@mdchaney
mdchaney / fix_encoding.rb
Last active August 2, 2025 11:35
Fix encoding to deal with mixed UTF-8 / Latin-1
def fix_encoding(str)
# The "b" method returns a copied string with encoding ASCII-8BIT
str = str.b
# Strip UTF-8 BOM if it's at start of file
if str.byteslice(0..2) == "\xEF\xBB\xBF".b
str = str.byteslice(3..-1)
end
if str.ascii_only?
@rain-1
rain-1 / base model trends.md
Last active December 25, 2025 23:27
base model trends.md

Namespaces 101

Introduction

Ruby has recently merged namespaces as an experimental feature that is disabled by default, as of this writing.

This is a non-trivial development driven by @matz himself, and mainly implemented by @tagomoris, who just became a Ruby committer (🎉).

The feature has been cooking for a long time, with a first ticket opened a couple of years ago (#19744) and a revised one opened just last week (#21311).

# Usage:
#
# class Post < ApplicationRecord
# include HasNanoid
# has_nanoid
# end
#
module HasNanoid
extend ActiveSupport::Concern
require "digest"
require "rack"
# This class encapsulates a unit of work done for a particular tenant, connected to that tenant's database.
# ActiveRecord makes it _very_ hard to do in a simple manner and clever stuff is required, but it is knowable.
#
# What this class provides is a "misuse" of the database "roles" of ActiveRecord to have a role per tenant.
# If all the tenants are predefined, it can be done roughly so:
#
# ActiveRecord::Base.legacy_connection_handling = false if ActiveRecord::Base.respond_to?(:legacy_connection_handling)
@joeldrapper
joeldrapper / fuzzy_index.rb
Created March 27, 2025 11:20
Simple fuzzy index with left weight
class FuzzyIndex
def initialize
@index = Hash.new { |h, k| h[k] = Set.new }
end
def []=(key, value)
trigrams(key).each { @index[it] << [key, value] }
end
def [](query)