First, verify which PostgreSQL versions are installed:
brew list | grep postgresqlThen, check the location of pg_restore:
which pg_restoreAnd confirm the version it is using:
Most high achievers wake up early because the early morning hours are free from distractions and allow for focused personal growth.
✅ More time for yourself before the world wakes up.
✅ Increased focus, creativity, and productivity.
✅ Less stress and more mental clarity.
✅ Helps build self-discipline and consistency.
| # config/packages/fos_user.yaml | |
| fos_user: | |
| db_driver: orm # other valid values are 'mongodb' and 'couchdb' | |
| firewall_name: main | |
| user_class: App\Entity\User | |
| from_email: | |
| address: "[email protected]" | |
| sender_name: "[email protected]" |
| # config/packages/security.yaml | |
| security: | |
| encoders: | |
| FOS\UserBundle\Model\UserInterface: bcrypt | |
| role_hierarchy: | |
| ROLE_ADMIN: ROLE_USER | |
| ROLE_SUPER_ADMIN: ROLE_ADMIN | |
| # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers |
| <?php | |
| // src/Entity/User.php | |
| namespace App\Entity; | |
| use FOS\UserBundle\Model\User as BaseUser; | |
| use Doctrine\ORM\Mapping as ORM; | |
| /** | |
| * @ORM\Entity |
Install this gem in project
gem 'recaptcha', require: 'recaptcha/rails'Get Recaptcha Pubic and Secret keys from Google Recaptcha Admin and Put the keys vars in your .env file
STRIPE_PUB_KEY='pk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxSTuV'
STRIPE_SEC_KEY='sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxWXYz'Use the below command to create "API Only" project.
rails new my_api_project --apiInstall JWT Gem
gem 'jwt'| # Project API application controller module | |
| class ApplicationController < ActionController::API | |
| before_action :authorized | |
| def encode_token(payload) | |
| JWT.encode(payload, ENV['APP_SECRET_TOKEN']) | |
| end | |
| def auth_header | |
| # { Authorization: 'Bearer <token>' } |
Install this gem in the project
gem 'metamagic'In layouts/application.html.erb file
<%=metamagic site: "InitCoders", title: [:title, :site], keywords: [:keywords, "keyword 1", "keyword 2"], description: "", separator: " - " %>| # frozen_string_literal: true | |
| # This file is copied to spec/ when you run 'rails generate rspec:install' | |
| require 'spec_helper' | |
| ENV['RAILS_ENV'] ||= 'test' | |
| require File.expand_path('../config/environment', __dir__) | |
| # Prevent database truncation if the environment is production | |
| abort('The Rails environment is running in production mode!') if Rails.env.production? | |
| require 'rspec/rails' | |
| require 'capybara/rspec' |