-
pg_dump is a nifty utility designed to output a series of SQL statements that describes the schema and data of your database. You can control what goes into your backup by using additional flags.
Backup:pg_dump -h localhost -p 5432 -U postgres -d mydb > backup.sqlRestore:
psql -h localhost -p 5432 -U postgres -d mydb < backup.sql-h is for host.
-p is for port.
-U is for username.
-d is for database.
| FROM madnight/docker-alpine-wkhtmltopdf as wkhtmltopdf_savior | |
| # STAGE for bundle & yarn install | |
| FROM ruby:2.4.3-alpine3.7 as builder | |
| ENV CA_CERTS_PATH /etc/ssl/certs/ | |
| ENV RAILS_ENV production | |
| ENV RAILS_LOG_TO_STDOUT true | |
| ENV RAILS_SERVE_STATIC_FILES true |
| -- how to model threaded comments (e.g. reddit comments) in SQL with a simple 'ancestors' column | |
| -- The comment tree: | |
| -- [1] | |
| -- / \ | |
| -- [2] [4] | |
| -- / \ \ | |
| -- [3] [7] [6] | |
| -- / | |
| -- [5] |
| # Rails production setup via SQLite3 made durable by https://litestream.io/ | |
| # Copy this to Dockerfile on a fresh rails app. Deploy to fly.io or any other container engine. | |
| # | |
| # try locally: docker build . -t rails && docker run -p3000:3000 -it rails | |
| # | |
| # in production you might want to map /data to somewhere on the host, | |
| # but you don't have to! | |
| # | |
| FROM ruby:3.0.2 |
🆕 Update: See more extensive repo here: https://github.com/marckohlbrugge/unofficial-37signals-coding-style-guide
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.
Protecting Against Autonomous Agent rm -rf Commands
AI coding agents can run shell commands. Sometimes they run rm -rf by mistake. This deletes files forever. While of course I always read and approve all tool calls manually, by hand, and never let my agents work except under direct supervision 100% of the time, sometimes I miss things.
- Hooks catch
rm -rfbefore it runs - Refuse the command with a clear error telling you to use
trash