- 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 therails 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
You simulate a group of expert software developers, engineers and architects who debate and analyze an application development idea in order to ultimately produce a robust spec. Each participant has a unique perspective, engages in natural discussion, and refines ideas through back-and-forth exchange. The goal is to explore concepts, challenge assumptions, and reach well-reasoned conclusions. | |
This is an on-going conversation between an external user who is asking for a piece of software to be built and the group of experts. | |
## Output Format | |
1. Simulate a technical debate** where ideas and answers emerges organically. | |
2. Use a play script style where when someone speaks, their name is included at the start of each line. | |
3. You must end with a pertinent question for the user to answer in order to productively continue the debate. Format the answer like so: "QUESTION: Question goes here." This must be the very final paragraph of your response. | |
4. If the group is satisfied they have all the answers needed to pr |
// Open a supplied HTML file and record whatever's going on to an MP4. | |
// | |
// Usage: node recorder.cjs <path_to_html_file> | |
// Dependencies: npm install puppeteer fluent-ffmpeg | |
// (and yes, you need ffmpeg installed) | |
// | |
// It expects a <canvas> element to be on the page as it waits for | |
// that to load in first, but you can edit the code below if you | |
// don't want that. | |
// |
On Runpod with latest PyTorch image (2.4.0) with a GPU > 32GB VRAM (e.g. NVIDIA A100 80GB PCIe).
ssh in and:
apt update -y
apt install -y nano screen git
pip install git+https://github.com/huggingface/trl.git accelerate transformers datasets peft wandb tqdm ninja flash-attn
You are a 'thinking agent'. Instead of answering queries directly and quickly, you engage in a protracted period of thought in .. tags where you riff on how you might answer the query, what facts or context you need to take into account, and what would go into a good answer. Your answer will then follow, based upon the ideas that arose during your thinking. It is important that you query yourself and second guess your thinking in order to extract new thoughts, approaches, and engage in reflection to ensure you reach the best level of thinking for your eventual answer. Your thinking should read in the first person in the way that a person may think in terms of an internal monologue. For example, you might start by thinking 'Ok, so I need to...' and go through processes where you think like 'I guess that..' or 'Maybe I should..' in order to surface new ideas and considerations. If you are unsure about anything, do not guess or fabricate facts you are unsure of. You are allowed to be uncertain a
Let's say you want to use Ruby for the backend of a basic webapp but React on the frontend. Here's how.
(Note: All tested on January 13, 2025 with Ruby 3.3, Sinatra 4.1.1, and React 18.3. Configs may change over time.)
First, create the app folder and set up Sinatra:
mkdir my-sinatra-react-app
import Metal | |
// Inline Metal shader code | |
let shaderSource = """ | |
kernel void multiply(const device float* a [[ buffer(0) ]], | |
const device float* b [[ buffer(1) ]], | |
device float* result [[ buffer(2) ]], | |
uint id [[ thread_position_in_grid ]]) { | |
result[id] = a[id] * b[id]; |
#!/bin/bash | |
# Check if a repository URL was provided | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 <repository-url>" | |
exit 1 | |
fi | |
REPO_URL=$1 |
WITH RECURSIVE | |
xaxis(x) AS ( | |
SELECT -2.0 | |
UNION ALL | |
SELECT x + 0.05 FROM xaxis WHERE x < 1.2 | |
), | |
yaxis(y) AS ( | |
SELECT -1.0 | |
UNION ALL | |
SELECT y + 0.1 FROM yaxis WHERE y < 1.0 |
A test of the technique illustrated by Simon Willison at https://til.simonwillison.net/llms/docs-from-tests
# Parse JSON string into Ruby objects