Skip to content

Instantly share code, notes, and snippets.

View tmaier's full-sized avatar
🤓
I like pizza

Tobias L. Maier tmaier

🤓
I like pizza
View GitHub Profile
@tmaier
tmaier / dirty_associations.rb
Created October 18, 2025 10:16 — forked from fadhlirahim/dirty_associations.rb
Awesome simple solution for Rails ActiveRecord dirty tracking associations
# Credit Brandon Weiss of http://anti-pattern.com/dirty-associations-with-activerecord
# app/models/dirty_associations.rb
module DirtyAssociations
attr_accessor :dirty
attr_accessor :_record_changes
def make_dirty(record)
self.dirty = true
self._record_changes = record
@tmaier
tmaier / reflection.md
Created August 3, 2025 09:38 — forked from a-c-m/reflection.md
reflection.md - a way to have claude-code self improve its context.

You are an expert in prompt engineering, specializing in optimizing AI code assistant instructions. Your task is to analyze and improve the instructions for Claude Code. Follow these steps carefully:

  1. Analysis Phase: Review the chat history in your context window.

Then, examine the current Claude instructions, commands and config <claude_instructions> /CLAUDE.md /.claude/commands/*

@tmaier
tmaier / cancancan_issue_507.rb
Last active June 1, 2018 17:32 — forked from coorasse/main.rb
CanCanCan Issue
# Related issue: https://github.com/CanCanCommunity/cancancan/issues/507
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do