Skip to content

Instantly share code, notes, and snippets.

View ericrochford's full-sized avatar

Eric Rochford ericrochford

View GitHub Profile
@peterc
peterc / CONVENTIONS.md
Last active April 23, 2025 06:55
CONVENTIONS.md file for AI Rails 8 development
  • You MUST NOT try and generate a Rails app from scratch on your own by generating each file. For a NEW app you MUST use rails new first to generate all of the boilerplate files necessary.
  • Create an app in the current directory with rails new .
  • Use Tailwind CSS for styling. Use --css tailwind as an option on the rails new call to do this automatically.
  • Use Ruby 3.2+ and Rails 8.0+ practices.
  • Use the default Minitest approach for testing, do not use RSpec.
  • Default to using SQLite in development. rails new will do this automatically but take care if you write any custom SQL that it is SQLite compatible.
  • An app can be built with a devcontainer such as rails new myapp --devcontainer but only do this if requested directly.
  • Rails apps have a lot of directories to consider, such as app, config, db, etc.
  • Adhere to MVC conventions: singular model names (e.g., Product) map to plural tables (products); controllers are plural.
  • Guard against incapable browsers accessing controllers with `allo
@jeremedia
jeremedia / ruby-structured-outputs-v4.rb
Last active April 10, 2025 18:53
Ruby implementation of OpenAI structured outputs
require 'json'
require 'dry-schema'
require 'openai'
require 'ostruct'
module StructuredOutputs
# Schema class for defining JSON schemas
class Schema
MAX_OBJECT_PROPERTIES = 100
MAX_NESTING_DEPTH = 5
@sentient06
sentient06 / Launchctl_Unload-10.14.sh
Created February 8, 2021 18:09 — forked from mmillar-bolis/Launchctl_Unload-10.14.sh
A Quick Little Script to Force Disable Certain LaunchDaemons in macOS
#!/bin/bash
# I have managed to map out some undesirable daemons and agents. Most of these
# can be disabled without too much consequence.
## Daemons
# com.apple.analyticsd - Anonymized application analytics daemon
# com.apple.appleseed.fbahelperd - Feedback Assistant Helper Daemon
# com.apple.awacsd - Apple Wide Area Connectivity Service Daemon
# com.apple.backupd - Apple TimeMachine service
@kirillshevch
kirillshevch / rails_new_options_help.md
Last active April 24, 2025 22:49
"rails new" options for generating a new Rails application

Run rails new --help to see all of the options you can use to create a new Rails application:

Output for Rails 8+

Usage:
  rails COMMAND [options]

You must specify a command:
@thomasgroch
thomasgroch / turn_off_mac_SIP_system_security.md
Last active July 8, 2024 20:37
Disables some default root agents and daemon on MacOS (Version 3)

How to use

1. boot in recovery (command+r)

You can temporarily disable SIP by rebooting into Recovery Mode (press and hold Command-R from the time the computer starts until you see the Apple logo), then opening Terminal from the Utilities menu and entering this command:

csrutil disable

2. boot in normal: