- 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 newfirst 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 tailwindas an option on therails newcall 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 newwill 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 --devcontainerbut 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
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
| defmodule MyApp.Http do | |
| @moduledoc """ | |
| Exposes functions to make HTTP requests and optionally cache the response. | |
| If you want to cache the request, simply add `cache: true` to the | |
| request options. You can also define an option time-to-live (TTL) with | |
| `cache_ttl: ttl_in_milliseconds`. The default TTL is 5min. | |
| Only caches 2xx responses. | |
| """ |
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
| ### Test on https://github.com/yousseb/meld/releases/tag/osx-20 | |
| ### OSX - 3.21.0 (r4) Sonoma | |
| ### !!! Note: You need put the Meld.app r4 build to the /Applications path first. | |
| #!/bin/zsh | |
| #Fix libpng16.16.dylib not found | |
| install_name_tool -change /usr/local/opt/libpng/lib/libpng16.16.dylib @executable_path/../Frameworks/libpng16.16.dylib /Applications/Meld.app/Contents/Frameworks/libfreetype.6.20.0.dylib | |
| #Fix libbrotlidec.1.dylib not found |
This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).
Matrix multiplication is a mathematical operation that defines the product of
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
| PROJECT LICENSE | |
| This project was submitted by Lara Martín as part of the Nanodegree At Udacity. | |
| As part of Udacity Honor code, your submissions must be your own work, hence | |
| submitting this project as yours will cause you to break the Udacity Honor Code | |
| and the suspension of your account. | |
| Me, the author of the project, allow you to check the code as a reference, but if | |
| you submit it, it's your own responsibility if you get expelled. |
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
| # Create a container from the mongo image, | |
| # run is as a daemon (-d), expose the port 27017 (-p), | |
| # set it to auto start (--restart) | |
| # and with mongo authentication (--auth) | |
| # Image used is https://hub.docker.com/_/mongo/ | |
| docker pull mongo | |
| docker run --name YOURCONTAINERNAME --restart=always -d -p 27017:27017 mongo mongod --auth | |
| # Using the mongo "localhost exception" (https://docs.mongodb.org/v3.0/core/security-users/#localhost-exception) | |
| # add a root user |
# Copy the awesome fonts to ~/.fonts
cd /tmp
git clone http://github.com/gabrielelana/awesome-terminal-fonts
cd awesome-terminal-fonts
git checkout patching-strategy
mkdir -p ~/.fonts
cp patched/*.ttf ~/.fonts
# update the font-info cache
NewerOlder