- 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.4.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 `al
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# git rename-remote-user - Change username in Git remote URLs | |
# Usage: git rename-remote-user [options] <old_username> <new_username> | |
# TODO: make it clear when nothing has changed. | |
# TODO: write tests with one of the following: | |
# - Bats |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# | |
# git-clean-ignore: Synchronize .gitignore patterns with tracked files | |
# | |
# This script scans a Git repository for files that match patterns in .gitignore | |
# but are still being tracked. It prompts the user to either remove these files | |
# from tracking or remove the corresponding patterns from .gitignore. | |
# | |
# Usage: | |
# git-clean-ignore [options] |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<details><summary>Zed.log</summary><pre> | |
<!-- Click below this line and paste or drag-and-drop your log--> | |
2024-10-04T00:04:02.983854-04:00 [INFO] ========== starting zed ========== | |
2024-10-04T00:04:02.988191-04:00 [INFO] Opening main db | |
2024-10-04T00:04:02.990823-04:00 [INFO] Opening main db | |
2024-10-04T00:04:03.018765-04:00 [INFO] Using git binary path: Some("/Applications/Zed.app/Contents/MacOS/git") | |
2024-10-04T00:04:03.229928-04:00 [ERROR] invalid binding value for keystroke cmd-alt-enter, context Some("Editor") | |
Caused by: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## you presumably already know that this returns false, because of the way floats are stored: | |
0.1 + 0.2 == 0.3 | |
# => false | |
# we can create a more useful way of comparing floats that matches what humans would expect: | |
class Float | |
def =~(number, tolerance = 0.0001) | |
(self - number).abs < tolerance | |
end |
In programming languages, literals are textual representations of values in the source code. This is a syntactical concept.
Some examples:
7 # integer literal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Overview | |
-------- | |
Consider the commands given to be examples, not to necessarily be precisely | |
what you will use. They were based on my circumstances, in which | |
* my local platform is macOS, | |
* where Homebrew is the de facto package manager; | |
* my laptop (and the server) are managing Ruby with rbenv; | |
* vim is my remote editor of choice, and an acceptable local editor; and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Goals | |
Editable by Supervisor | |
Employee Data Safe | |
Supervisor Edits Goals -> Editable by Supervisor | |
Supervisor Assigns Rights to Employee -> Editable by Employee | |
Employee Data Lost | |
No Simple Solution -> Employee Data Lost | |
Editable by Employee | |
Employee Data Still Safe | |
Employee Begins Editing Goals -> Employee Data at Risk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://wikihub.berkeley.edu/display/robots/CC+-+20181213+More+Changes+to+Pilot+Specs | |
Proposed Performance Pilot Workflow - Newest | |
No Review Exists* | |
Create New Form -> Supervisor Starts Form | |
Review In Process | |
Supervisor Starts Form | |
Save -> Draft | |
Save & Share with Employee -> Participants Comment and Sign | |
New* | |
Draft |
NewerOlder