Skip to content

Commit 749a09f

Browse files
Merge branch 'main' into main
2 parents b03e031 + 8d92cfb commit 749a09f

File tree

112 files changed

+6543
-57
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+6543
-57
lines changed

admin/scripts/formatLighthouseReport.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
/** @type {Record<keyof LighthouseSummary, string>} */
99
const summaryKeys = {
10-
performance: "Performance 🚀",
11-
accessibility: "Accessibility",
12-
"best-practices": "Best Practices 💡",
13-
seo: "SEO 🔍",
10+
performance: "Performance",
11+
accessibility: "Accessibility",
12+
"best-practices": "Best Practices",
13+
seo: "SEO",
1414
};
1515

1616
/** @param {number} rawScore */
@@ -44,11 +44,11 @@ const createMarkdownTableRow = ({ url, summary, reportUrl }) =>
4444
.../** @type {(keyof LighthouseSummary)[]} */ (
4545
Object.keys(summaryKeys)
4646
).map((k) => scoreEntry(summary[k])),
47-
`[Report](${reportUrl}) 📄 |`,
47+
`[📄](${reportUrl}) |`,
4848
].join(" | ");
4949

5050
const createMarkdownTableHeader = () => [
51-
["| URL 🌐", ...Object.values(summaryKeys), "Report 📊 |"].join(" | "),
51+
["| URL 🌐", ...Object.values(summaryKeys), "📊 |"].join(" | "),
5252
["|---", ...Array(Object.keys(summaryKeys).length).fill("---"), "---|"].join(
5353
"|",
5454
),

blog/authors.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,9 @@ santhosh-siddhardha:
6464
title: Software Engineer
6565
url: "https://github.com/Santhosh-Siddhardha"
6666
image_url: https://avatars.githubusercontent.com/u/103999924?v=4
67+
68+
nayanika-mukherjee:
69+
name: Nayanika Mukherjee
70+
title: Full Stack Developer
71+
url: "https://github.com/Nayanika1402"
72+
image_url: https://avatars.githubusercontent.com/u/132455412?v=4

blog/automating-tasks-with-python.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
---
2+
title: 'Automating Tasks with Python: Using the OS and Subprocess Modules'
3+
sidebar_label: Automating Tasks with Python
4+
authors: [nayanika-mukherjee]
5+
tags: [automation, Python, OS module, Subprocess module, technology]
6+
date: 2024-07-13
7+
hide_table_of_contents: true
8+
---
9+
10+
## Introduction
11+
12+
Automation is a powerful way to boost productivity and efficiency by minimizing manual intervention in repetitive tasks. Python, with its versatile libraries and modules, provides an excellent framework for task automation. This blog explores how to use Python's OS and Subprocess modules to automate various system-level tasks, including file and directory operations and executing system commands.
13+
14+
## What is Task Automation?
15+
16+
Task automation involves using software to perform tasks without human intervention. Python is a popular choice for automation due to its simplicity, readability, and extensive standard library. Common automation tasks include file management, data processing, and executing system commands. Automating these tasks can save time, reduce errors, and improve consistency.
17+
18+
## Using the OS Module for File and Directory Operations
19+
20+
The OS module in Python provides a way to interact with the operating system. It allows you to perform tasks such as creating, deleting, and modifying files and directories. Here are some key functions of the OS module:
21+
22+
### File Operations
23+
24+
- **Creating a File**: `os.open()` and `os.close()`
25+
- **Reading from a File**: `os.read()`
26+
- **Writing to a File**: `os.write()`
27+
- **Deleting a File**: `os.remove()`
28+
29+
### Directory Operations
30+
31+
- **Creating a Directory**: `os.mkdir()`
32+
- **Listing Directory Contents**: `os.listdir()`
33+
- **Changing the Current Directory**: `os.chdir()`
34+
- **Removing a Directory**: `os.rmdir()`
35+
36+
### Example: Creating and Listing Directories
37+
38+
```python
39+
import os
40+
41+
# Create a new directory
42+
os.mkdir('new_directory')
43+
44+
# Change the current directory
45+
os.chdir('new_directory')
46+
47+
# List contents of the current directory
48+
print(os.listdir('.'))
49+
```
50+
51+
## Running System Commands with the Subprocess Module
52+
53+
The Subprocess module allows you to spawn new processes, connect to their input/output/error pipes, and obtain their return codes. This is particularly useful for running system commands and scripts from within a Python program.
54+
55+
### Key Functions in the Subprocess Module
56+
57+
- **subprocess.run()**: Run a command and wait for it to complete.
58+
- **subprocess.Popen()**: Execute a child program in a new process.
59+
60+
### Example: Running a Simple Command
61+
62+
```python
63+
import subprocess
64+
65+
# Run a simple system command
66+
result = subprocess.run(['echo', 'Hello, World!'], capture_output=True, text=True)
67+
print(result.stdout)
68+
```
69+
70+
### Example: Executing a Script
71+
72+
```python
73+
import subprocess
74+
75+
# Execute a Python script
76+
result = subprocess.run(['python', 'script.py'], capture_output=True, text=True)
77+
print(result.stdout)
78+
```
79+
80+
## Combining OS and Subprocess Modules for Complex Tasks
81+
82+
You can combine the functionalities of the OS and Subprocess modules to automate more complex workflows. For example, you might use the OS module to navigate the file system and the Subprocess module to execute a series of commands or scripts based on the files and directories found.
83+
84+
### Example: Automating a Backup Process
85+
86+
```python
87+
import os
88+
import subprocess
89+
import shutil
90+
91+
# Create a backup directory
92+
backup_dir = 'backup'
93+
if not os.path.exists(backup_dir):
94+
os.mkdir(backup_dir)
95+
96+
# Copy files to the backup directory
97+
for file_name in os.listdir('.'):
98+
if os.path.isfile(file_name):
99+
shutil.copy(file_name, backup_dir)
100+
101+
# Compress the backup directory using a system command
102+
subprocess.run(['zip', '-r', 'backup.zip', backup_dir])
103+
```
104+
105+
## Conclusion
106+
107+
Automating tasks with Python using the OS and Subprocess modules can significantly enhance productivity by reducing the need for manual intervention in repetitive tasks. Whether you're managing files and directories or running system commands, these modules provide powerful tools for developing efficient automation scripts. By leveraging Python's capabilities, you can streamline workflows, improve accuracy, and free up time for more critical tasks.
108+
109+
With the foundational knowledge provided in this blog, you're well-equipped to start exploring and implementing your own task automation solutions using Python.
110+
111+
## Additional Resources
112+
113+
To further deepen your understanding of Python's automation capabilities, consider exploring the following resources:
114+
115+
- [Python's OS Module Documentation](https://docs.python.org/3/library/os.html)
116+
- [Python's Subprocess Module Documentation](https://docs.python.org/3/library/subprocess.html)
117+
- [Automate the Boring Stuff with Python](https://automatetheboringstuff.com/)
118+
119+
By delving into these materials, you'll gain more insights and practical skills to enhance your automation projects.

courses/tailwindCSS/Overview.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
title: Welcome to Learning Path
3+
sidebar_label: Course Overview
4+
sidebar_position: 1
5+
description: Tailwind CSS is a utility-first CSS framework that allows you to rapidly build custom user interfaces.
6+
tags: [courses,tailwind,CSS,HTML,overView]
7+
keywoards: [courses,tailwind CSS, web development, front-end development]
8+
author: [CodeHarborHub, Ajay Dhangar]
9+
---
10+
11+
12+
#### Beginner Level
13+
14+
**1. Introduction to Tailwind CSS**
15+
- What is Tailwind CSS? & Benefits
16+
- Installing and setting up Tailwind CSS
17+
- Basic structure and syntax
18+
19+
**2. Utility-First Concept**
20+
- Understanding & Applying utility classes
21+
- Combining utility classes
22+
23+
**3. Responsive Design**
24+
- Responsive & Breakpoints and media queries
25+
- Creating responsive layouts
26+
27+
**4. Text and Typography**
28+
- Typography utilities
29+
- Font sizes, weights, and styles
30+
- Line height and letter spacing
31+
- Text alignment and decoration
32+
33+
**5. Backgrounds and Borders**
34+
- Background colors and images
35+
- Gradient backgrounds
36+
- Border styles, widths, and colors
37+
- Rounded corners and shadows
38+
39+
**6. Flexbox and Grid Layout**
40+
- Flexbox
41+
- Grid
42+
43+
**7. Spacing and Sizing**
44+
- Margin and padding utilities
45+
- Width,Max-width,height and Max-height utilities
46+
47+
**8. Customizing Tailwind CSS**
48+
- Using the Tailwind configuration file
49+
- Extending the default theme
50+
- Adding custom colors and fonts
51+
52+
#### Intermediate Level
53+
54+
**1. Advanced Layout Techniques**
55+
- Advanced flexbox utilities
56+
- Advanced grid layout techniques
57+
- Positioning utilities
58+
59+
**2. Component Design**
60+
- Building reusable components with Tailwind CSS
61+
- Using Tailwind CSS with component libraries
62+
- Creating responsive and accessible components
63+
64+
**3. Forms and Inputs**
65+
- Styling form elements
66+
- Customizing form controls
67+
- Handling form validation states
68+
69+
**4. Interactivity and Transitions**
70+
- Adding hover, focus, and active states
71+
- Using transition utilities
72+
- Creating animations with Tailwind CSS
73+
74+
**5. Dark Mode and Theming**
75+
- Enabling dark mode
76+
- Creating custom themes
77+
- Switching between light and dark modes
78+
79+
**6. Custom Directives and Plugins**
80+
- Creating custom utilities with @apply
81+
- Using Tailwind CSS plugins
82+
- Writing custom plugins
83+
84+
#### Advanced Level
85+
86+
**1. Advanced Configuration**
87+
- Deep dive into the Tailwind configuration file
88+
- Advanced theming and customization
89+
- Creating custom utility classes
90+
91+
**2. Tailwind CSS with Frameworks**
92+
- Using Tailwind CSS with React
93+
- Using Tailwind CSS with Vue.js
94+
- Using Tailwind CSS with Angular
95+
96+
**3. State Variants**
97+
- Creating and using state variants
98+
- Group, peer, and sibling variants
99+
- Combining multiple state variants
100+
101+
**4. Dynamic Styles with Tailwind CSS**
102+
- Using Tailwind CSS with JavaScript
103+
- Dynamic class generation
104+
- Conditional styling
105+
106+
**5. Advanced Animations**
107+
- Creating complex animations
108+
- Using keyframes and animation utilities
109+
- Combining animations and transitions
110+
111+
This outline covers essential topics at each level, ensuring learners progress from basic to advanced concepts and techniques in Tailwind CSS.

courses/tailwindCSS/_category_.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"label": "Tailwind CSS",
3+
"position": 7,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "Learn Tailwind CSS with easy animation and styling."
7+
}
8+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
id: lesson-1
3+
title: "Creating Complex Animations"
4+
sidebar_label: Complex Animations
5+
sidebar_position: 1
6+
description: "Creating Complex Animations"
7+
tags: [courses,tailwind,Creating Complex Animations,Advanced-level,Introduction]
8+
---
9+
10+
Tailwind CSS provides utilities for creating complex animations, but you can also define custom animations using keyframes and utility classes.
11+
12+
##### Example: Basic Animation
13+
###### HTML
14+
```html
15+
<div class="animate-bounce bg-blue-500 text-white p-4 rounded-md">
16+
Bouncing Animation
17+
</div>
18+
```
19+
20+
##### Custom Keyframes
21+
You can define custom keyframes in your `tailwind.config.js` file.
22+
23+
###### Configuration
24+
```javascript
25+
module.exports = {
26+
theme: {
27+
extend: {
28+
keyframes: {
29+
wiggle: {
30+
'0%, 100%': { transform: 'rotate(-3deg)' },
31+
'50%': { transform: 'rotate(3deg)' },
32+
},
33+
},
34+
animation: {
35+
wiggle: 'wiggle 1s ease-in-out infinite',
36+
},
37+
},
38+
},
39+
plugins: [],
40+
}
41+
```
42+
43+
###### HTML
44+
```html
45+
<div class="animate-wiggle bg-red-500 text-white p-4 rounded-md">
46+
Custom Wiggle Animation
47+
</div>
48+
```
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
id: lesson-2
3+
title: "Using Keyframes and Animation Utilities"
4+
sidebar_label: Keyframes and Animation
5+
sidebar_position: 2
6+
description: "Using Keyframes and Animation Utilities"
7+
tags: [courses,tailwind,Keyframes and Animation,Advanced-level,Introduction]
8+
---
9+
10+
11+
##### Step 1: Define Keyframes
12+
Define keyframes in your Tailwind CSS configuration.
13+
14+
###### Configuration
15+
```javascript
16+
module.exports = {
17+
theme: {
18+
extend: {
19+
keyframes: {
20+
fadeIn: {
21+
'0%': { opacity: 0 },
22+
'100%': { opacity: 1 },
23+
},
24+
slideIn: {
25+
'0%': { transform: 'translateX(-100%)' },
26+
'100%': { transform: 'translateX(0)' },
27+
},
28+
},
29+
animation: {
30+
fadeIn: 'fadeIn 2s ease-in-out',
31+
slideIn: 'slideIn 1s ease-out forwards',
32+
},
33+
},
34+
},
35+
plugins: [],
36+
}
37+
```
38+
39+
##### Step 2: Use Animation Utilities
40+
Apply the custom animations to your elements.
41+
42+
###### HTML
43+
```html
44+
<div class="animate-fadeIn bg-green-500 text-white p-4 rounded-md">
45+
Fade In Animation
46+
</div>
47+
<div class="animate-slideIn bg-yellow-500 text-white p-4 rounded-md mt-4">
48+
Slide In Animation
49+
</div>
50+
```

courses/tailwindCSS/advance-level/Advanced-Animations/_category_.json

Whitespace-only changes.

0 commit comments

Comments
 (0)