Module: Programming Languages
Topics: HTML & CSS
Introduction to HTML
In order to build the website, it is required to use the HTML to create the skeleton of the webpage. HTML is all about elements we can use elements to display different type of content on the webpage.
Tags decide how the Elements will display on the webpage.
Some HTML tags are:
- <!DOCTYPE html>:
- Specifies the HTML version being used (HTML5 in most modern web development).
- <html>:
- The root element of an HTML page.
- <head>:
- Contains meta-information about the HTML document, such as title, character set, links to stylesheets, etc.
- <title>:
- Sets the title of the HTML document, which appears in the browser’s title bar or tab.
- <body>:
- Contains the content of the HTML document, such as text, images, links, etc.
- <h1> to <h6>:
- Headings, with <h1> being the largest and <h6> the smallest. Used to define headings and subheadings.
- <p>:
- Defines a paragraph.
- <a>:
- Creates hyperlinks to other pages or resources.
- <img>:
- Embeds images in the HTML document.
- <ul>, <ol>, <li>:
- Used for creating unordered lists, ordered lists, and list items, respectively.
- <div>:
- A container that is often used to group and style other HTML elements.
- <span>:
- Similar to <div>, but used for smaller, inline styling or grouping.
CSS
CSS, which stands for Cascading Style Sheets, is a stylesheet language used to describe the presentation of a document written in HTML or XML (including XML dialects such as SVG or XHTML).
BEM
BEM (which stands for Block-Element-Modifier) is a naming convention standard for CSS class names. It has fairly wide adoption and is immensely useful in writing CSS that is easier to read, understand, and scale.
A BEM class name can contain up to three parts.
- Block: The outermost parent element of the component is defined as the block.
- Element: Inside of the component may be one or more children called elements.
- Modifier: Either a block or element may have a variation signified by a modifier.
Here is how it will look after including all the three parts together:
[block]__[element]--[modifier]
Reference taken from: link
Rate limitter
It is a strategy for limiting network traffic. It can help us prevent DDOS (Distributed Denial-of-Service (DDoS) Attack onto our application. The primary purpose of a rate limiter is to control the rate at which requests or connections are made to a server or application.
CRON JOB
A cron job is a scheduled task that runs automatically at specified intervals on Unix-like operating systems. It is a time-based job scheduler in Unix and Unix-like operating systems.
Common Time Units:
*
(asterisk): Matches any value.0-59
: Represents minutes.0-23
: Represents hours.1-31
: Represents days of the month.1-12
: Represents months.0-6
(Sunday to Saturday): Represents days of the week.
We can edit our crontab using the crontab
command. To open the crontab for editing, you can use:
crontab -e
To export the cronjob logs we can use below command:
To store the output of a cron job to a file, we can use the > or >> operators.
*/5 * * * * /command > /output/file/path/cron.log 2>&1
where: ‘2>&1’ it basically combines errors and messages and sent it together.
“Good Work. Good People.”
Leave a Reply