author avatar

soniya.rayabagi

Mon Dec 04 2023

How we can Set up Puma as Systemd service in Ubuntu 18 for Rails application, The main purpose is , • to ensure it starts automatically on boot, • can be managed easily with systemd's service management commands, • It also allows for better process management, automatic restarts in case of failure, and logging capabilities, • few set of commands used to create puma.service file and getting it started: for file creation : /etc/systemd/system/puma.service sudo systemctl daemon-reload sudo systemctl enable puma sudo service puma start sudo service puma status

author avatar

nisanth

Thu Nov 30 2023

Retrieving Command History with FZF Command: To view the command history, we can use the following command: history | fzf Note: Ensure that you have FZF installed before. It provides an efficient way to navigate through past commands.

author avatar

mahrukh.mir

Thu Nov 30 2023

Components: Components are user interface elements that can be reused throughout the design file. They make design more consistent and allow for more rapid modifications. Components can be made from a layer , groups or frames.

• Generally, there are two sorts of components:

  1. Main Component: It is normally built first and is responsible for specifying several UI styles in the UI element.
  2. Instance Component: This is the single occurrence main component. When the main component is modified. It is automatically applied to the instance component. However, modifications to Instance components must be made manually.

The changes we make to the instance component are referred to as override. When we override an instance component and afterwards make modifications to the main component, the override does not change.

author avatar

ayushsrivastava

Thu Nov 30 2023

Lambda A lambda is a way to define a block & its parameters with some special syntax. You can save this lambda into a variable for later use. The syntax for defining a Ruby lambda looks like this: say_something = -> { puts "This is a lambda" }

author avatar

ayushsrivastava

Thu Nov 30 2023

Scopes Scopes are custom queries that you define inside your Rails models with the scope method. Every scope takes two arguments:

  1. A name, which you use to call this scope in your code.
  2. A lambda, which implements the query. It looks like this:
   scope :with_juice, -> { where("juice > 0") }
end```
author avatar

satya

Thu Nov 30 2023

RSpec double is a method provided by the RSpec library for creating test doubles, also known as mocks. Test doubles are objects that stand in for real objects in your system during tests.

author avatar

satya

Wed Nov 29 2023

if we are using tailwindcss-rails gem we don't need cssbundling-rails gem because tailwindcss-rails gem is a standalone version of Tailwind CSS that integrates with rails asset pipeline. It's a simpler and more direct alternative for rails applications because it doesn't require Node.js at all.

author avatar

ayushsrivastava

Wed Nov 29 2023

.abs method in Ruby is used to return the absolute value of a number. The absolute value of a number is its distance from zero, regardless of direction. In other words, it's the number without its sign. Here's an example:

puts num.abs # Outputs: 10```
In this example, `num.abs` returns `10` because the absolute value of `-10` is `10`.
Similarly, for a positive number:
```num = 10
puts num.abs # Outputs: 10```
author avatar

syedsibtain

Tue Nov 28 2023

How to drop DB and add new database dump in Mongo db.

  1. Open terminal and enter mongo
  2. Enter show dbs to list all the databases
  3. Enter use <dbname> and select the database.
  4. Enter db and this will show the selected database (optional)
  5. Enter db.dropDatabase() and it will drop the database and show the following response { "dropped" : "<dbname>", "ok" : 1 }

To add a new data dump, use the below command.

  1. mongorestore --db <dbname> <path>
author avatar

mahrukh.mir

Mon Nov 27 2023

Gestalt Principles: It explains how humans perceive visual aspects and how the human brain creates order from chaos. The human brain organizes and simplifies complicated visuals composed of numerous components into a single entire system. Humans will look for patterns and structure to create an image rather than seeing distinct, separate components.

Some Gestalt Principles are as follows:

1. Similarity: when two elements appear to be similar, we group them together. We also prefer to believe they serve the same purpose. Elements with similar shapes, sizes, color's, or orientations are believed to be related.

2. Proximity: The elements that are close together appear to be more linked than things that are farther apart.

3. Closure: When there are gaps or missing portions, our brain fills in the gaps to perceive a full shape or entity.

4. Focal point: Visual elements that stand out will catch and hold the viewer's attention right away.

5. Invariance: People can distinguish objects regardless of their shape, rotation, or scale.

6. Continuity: Elements placed on a line or curve appear to be more connected than elements not arranged on a line or curve.

Showing 1 to 5 of 46 results