- 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
For years, people have been using jemalloc with ruby. There were various benchmarks and discussions. Legend had it that Jemalloc 5 didn't work as well as Jemalloc 3.
Then, one day, hope appeared on the horizon. @wjordan offered a config for Jemalloc 5.
FROM ruby:3.1.2-bullseye
RUN apt-get update ; \
# frozen_string_literal: true | |
# | |
# Uncomment this and change the path if necessary to include your own | |
# components. | |
# See https://github.com/heartcombo/simple_form#custom-components to know | |
# more about custom components. | |
# Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f } | |
# | |
# Use this setup block to configure all options available in SimpleForm. | |
SimpleForm.setup do |config| |
# frozen_string_literal: true | |
module StocksGames | |
class SendWrapped2020Emails < Micro::Case::Strict | |
attribute :file_path | |
def call! | |
parse_json | |
.then(apply(:group_by_user)) | |
.then(apply(:collect_name_and_valid_wallets)) |
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.
Agree? Disagree? Feel free to let me know at @JanStette.
Keep it simple, stupid. You ain't gonna need it.
Update 2023/03/02: Using Pop!_OS 22.04 LTS. Just install and enjoy, not much to say about, it just works.
Update 2020/05/19: I'm using PopOS 20.04. Works great!!
NOTE: At the moment Dell G3 series doesn't officially support Ubuntu 18.04.
This post on Reddit: https://www.reddit.com/r/Ubuntu/comments/b74vvb/ubuntu_1604_on_dell_g3/
I recently had to upgrade my blog, which involved changes such as:
- Replacing a sitemap plugin
- Upgrading from jekyll 2.5.3 to 3.8.4
- Upgrading from jekyll-assets 0.7.8 to 3.0.11
- (etc)
The upgrading process was not trivial, and some parts (e.g. RSS, sitemap, or twitter cards tags) are not immediately visible, so I decided to add unit tests on the generated content.
- Website: https://stimulusjs.org/
- GitHub repo: https://github.com/stimulusjs/stimulus
- Handbook: https://stimulusjs.org/handbook/introduction
- Discourse: https://discourse.stimulusjs.org/
initialize
: once, when the controller is first instantiatedconnect
: anytime the controller is connected to the DOM
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.