Fueling Curiosity, One Insight at a Time
At Codemancers, we believe every day is an opportunity to grow. This section is where our team shares bite-sized discoveries, technical breakthroughs and fascinating nuggets of wisdom we've stumbled upon in our work.
Dec 13, 2023
below are the generator helper methods used to perform various actions in files and directories
• copy_file
• create_file
• insert_into_file
• inside
• gsub_file
• copy_file
• create_file
• insert_into_file
• inside
• gsub_file
satya
Dec 12, 2023
generate generator by doing
This will create the below files for you
bin/rails generate generator initializer
.This will create the below files for you
create lib/generators/initializer
create lib/generators/initializer/initializer_generator.rb
create lib/generators/initializer/USAGE
create lib/generators/initializer/templates
create spec/generator/initializers_generator_spec.rb
satya
Dec 12, 2023
Slack apps best practices and User experience - https://api.slack.com/best-practices
hilda
Dec 4, 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 :
• 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
soniya.rayabagi
Nov 30, 2023
Retrieving Command History with FZF
Command: To view the command history, we can use the following command:
Note: Ensure that you have FZF installed before. It provides an efficient way to navigate through past commands.
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.
nisanth
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
• 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
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.mahrukh.mir
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:
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" }
Ayush Srivastava
System Analyst
Nov 30, 2023
Scopes
Scopes are custom queries that you define inside your Rails models with the
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:
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:
class Fruit < ApplicationRecord
scope :with_juice, -> { where("juice > 0") }
end
Ayush Srivastava
System Analyst
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.satya
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.satya
Showing 32 to 34 of 77 results
Ready to Build Something Amazing?
Codemancers can bring your vision to life and help you achieve your goals
- Address
2nd Floor, Zee Plaza,
No. 1678, 27th Main Rd,
Sector 2, HSR Layout,
Bengaluru, Karnataka 560102 - Contact
hello@codemancers.com
+91-9731601276