The next version of TurboBoost will ship with generators to help you get started with Commands quickly.
- View help for the generator
bin/rails g turbo_boost:command -h
Usage:
bin/rails generate turbo_boost:command NAME [options]
When crafting prompts for AI or LLMs, you can adjust various inputs or variables to tailor the model's responses. Here's a simple guide to understanding what each of these terms means:
prompt
: The question or statement you provide to the model, essentially telling it what you want to know or do.
max_tokens
: Limits how long the AI's response can be, like setting a maximum number of words or sentences it can use to answer.
50
- Makes the AI provide a concise, often one-sentence reply.
# Builds an SQL insert query for a given record | |
# | |
# @param record [ActiveRecord::Base] Record used to build the SQL insert query | |
# @return [String] SQL insert query | |
def build_insert_query(record) | |
columns = record.class.columns.reject { |col| col.name == record.class.primary_key } | |
values = columns.map { |col| record[col.name] } | |
insert_manager = Arel::InsertManager.new | |
insert_manager.into(record.class.arel_table) | |
insert_manager.insert(columns.zip(values)).to_sql |
System tests with Rails, Capybara, and Selenium (with the Chrome driver) may go rogue and spike the CPU to 100% on the spawned browser depending on how heavily you've monkey patched these libraries and/or have complex JavaScript that mutates the DOM (morphs etc.).
This supervisor class monitors the driver process and its children and will kill any rogue process that persistently spikes to >=99% CPU utilization for an extended period of time. If and when this occurs, you lose control of the browser and your tests will hang until they eventually time out or error.
I created this to help me run benchmarks/comparisons against Universal ID, but it could serve as the foundation for a robust ETL data pipeline... and it's less than 70 LOC right now! 🤯 🚀
It handles the extract and transform parts of an ETL process and supports the following options:
only
- specify which attributes to includeFROM ruby:3.2.2-alpine | |
# ============================================================================================================ | |
# Install system packages | |
# ============================================================================================================ | |
RUN apk add --no-cache --update \ | |
bash \ | |
build-base \ | |
curl \ | |
gcompat \ |
# ActiveJob natively captures constructor arguments in an `@arguments` instance variable | |
# which is also exposed as an `arguments` property on each job instance. | |
# | |
# Calls to `perform_now` and `perform_later` both forward arguments to the constructor. | |
# | |
# For example, all of these invocation styles work. | |
# | |
# result = DoStuffJob.new("foobar").perform # sync | |
# result = DoStuffJob.new.perform("foobar") # sync | |
# result = DoStuffJob.perform_now("foobar") # sync |
This gist aims to provide a simple solution for managing Heroku Review Apps with GitHub Actions due to the security incident that continues to disrupt Heroku's GitHub integration. Watch the demo to learn more.
.github
├── workflows
│ ├── heroku_review_app_create.yml