Skip to content

Instantly share code, notes, and snippets.

View mcsee's full-sized avatar
🏠
Working from home

mcsee mcsee

🏠
Working from home
View GitHub Profile
@mcsee
mcsee / directory.php
Created February 3, 2026 21:53
This gist belongs to the Clean Code Cookbook https://cleancodecookbook.com by Maximiliano Contieri https://maximilianocontieri.com
<?
class UserDirectory {
// 1. Create a new class to represent the specific collection
// This is a real world concept reified
// 2. Define a private property
private array $elements = [];
// 3. Implement a constructor that accepts only User types
public function __construct(User ...$users) {
@mcsee
mcsee / anemic collection.php
Last active February 4, 2026 12:48
This gist belongs to the Clean Code Cookbook https://cleancodecookbook.com by Maximiliano Contieri https://maximilianocontieri.com
<?
/** @var User[] $users */
// this is a static declaration used by many IDEs but not the compiler
// Like many comments it is useless, and possible outdated
function notifyUsers(array $users) {
foreach ($users as $user) {
// You have no guarantee $user is actually a User object
// The comment above is
@mcsee
mcsee / Hygiene.md
Last active February 3, 2026 13:55
This gist belongs to the Clean Code Cookbook https://cleancodecookbook.com by Maximiliano Contieri https://maximilianocontieri.com

Sort the data from @kessler.py#L23.

Update the tests using the skill 'run-tests'.

@mcsee
mcsee / polluted.md
Last active February 3, 2026 13:54
This gist belongs to the Clean Code Cookbook https://cleancodecookbook.com by Maximiliano Contieri https://maximilianocontieri.com

Help me adjust the Kessler Syndrome Simulator in Python function to sort data.

Also, can you review this JavaScript code?

And I need some SQL queries tracking crashing satellites, too.

Use camelCase.

Actually, use snake_case instead. Make it functional.

@mcsee
mcsee / skill.md
Last active January 26, 2026 19:40
This gist belongs to the Clean Code Cookbook https://cleancodecookbook.com by Maximiliano Contieri https://maximilianocontieri.com

Use the PHP-Clean-Code skill.

Create a tax calculator function from the business specification taxes.md

Follow the 'Early Return' rule defined in that skill.

@mcsee
mcsee / agent prompt.md
Created January 26, 2026 19:38
This gist belongs to the Clean Code Cookbook https://cleancodecookbook.com by Maximiliano Contieri https://maximilianocontieri.com

Here are 50 pages of our company coding standards and business rules.

Now, please write a simple function to calculate taxes.

@mcsee
mcsee / good prompt.md
Last active January 17, 2026 01:32
This gist belongs to Clean Code Cookbook http://cleancodecookbook.com By Maximiliano Contieri http://maximilianocontieri.com

Read @Dashboard.tsx and @api.ts. Do not write code yet.

Analyze the stack dump.

When you find the problem, explain it to me.

Then, write a Markdown plan to fix it, restricted to the REST API..

[Activate Code Mode]

@mcsee
mcsee / vague instruction.md
Last active January 17, 2026 01:31
This gist belongs to Clean Code Cookbook http://cleancodecookbook.com By Maximiliano Contieri http://maximilianocontieri.com

Fix the probabilistic predictor in the Kessler Syndrome Monitor component using this stack dump.

@mcsee
mcsee / english.md
Created January 9, 2026 16:41
This gist belongs to Clean Code Cookbook http://cleancodecookbook.com By Maximiliano Contieri http://maximilianocontieri.com

Refactor this code and make it cleaner

@mcsee
mcsee / spanish.md
Created January 9, 2026 16:40
This gist belongs to Clean Code Cookbook http://cleancodecookbook.com By Maximiliano Contieri http://maximilianocontieri.com

Mejorá este código y hacelo más limpio