Skip to content

Instantly share code, notes, and snippets.

🆕 Update: See more extensive repo here: https://github.com/marckohlbrugge/unofficial-37signals-coding-style-guide

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.

# Put in config/initializers/html_sanitizer.rb
#
# See https://github.com/rails/rails-html-sanitizer/blob/master/lib/rails/html/scrubbers.rb
# for more help on how the PermitScrubber works and the functions you can override.
class CustomScrubber < Rails::Html::PermitScrubber
def initialize
super
puts("CustomScrubber says hi!")
self.tags = %w( script iframe figure figcaption action-text-attachment )
@brianlmoon
brianlmoon / apache_cors_example
Last active April 22, 2025 09:41
CORS example for Apache with multiple domains
# Sets CORS headers for request from example1.com and example2.com pages
# for both SSL and non-SSL
SetEnvIf Origin "^https?://[^/]*(example1|example2)\.com$" ORIGIN=$0
Header set Access-Control-Allow-Origin %{ORIGIN}e env=ORIGIN
Header set Access-Control-Allow-Credentials "true" env=ORIGIN
# Always set Vary: Origin when it's possible you may send CORS headers
Header merge Vary Origin