dev-resources.site
for different kinds of informations.
Day 01 , what did learn
Published at
12/22/2024
Categories
webdev
frontend
devjournal
javascript
Author
coderkun
Author
8 person written this
coderkun
open
i am learning C++ to become a game dev but i thought why not learn web dev with it so i started learning front end and will be posting my journey from now on .
Here is a Single-Page Front-End Development Cheat Sheet for quick reference:
HTML (HyperText Markup Language)
- Basic Structure:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Title</title>
</head>
<body>
<header></header>
<main></main>
<footer></footer>
</body>
</html>
-
Elements:
- Basic Tags:
<div>
,<span>
,<h1> - <h6>
,<p>
,<a>
,<img>
,<button>
,<ul>
,<ol>
,<li>
- Basic Tags:
-
Common Attributes:
-
id
,class
,src
,href
,alt
,style
-
CSS (Cascading Style Sheets)
- Syntax:
selector {
property: value;
}
-
Selectors:
-
element
,.class
,#id
,element.class
,element#id
- Pseudo-classes:
:hover
,:active
,:focus
- Pseudo-elements:
::before
,::after
-
-
Layout Techniques:
- Flexbox:
.container { display: flex; justify-content: center; align-items: center; flex-direction: row; /* or column */ }
- Grid:
.grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
-
Positioning:
-
static
,relative
,absolute
,fixed
,sticky
-
-
Box Model:
- Margin, Padding, Border, Content
div {
margin: 10px;
padding: 20px;
border: 1px solid #000;
}
- Media Queries (for Responsiveness):
@media screen and (max-width: 768px) {
.container {
display: block;
}
}
JavaScript
- Variables:
let variable = "value"; // Mutable
const constant = "value"; // Immutable
- Functions:
function myFunction() {
console.log("Hello");
}
const myArrowFunction = () => console.log("Hello");
-
DOM Manipulation:
- Access and modify elements:
const el = document.getElementById('id'); el.style.color = "red"; el.innerHTML = 'New Content';
Event Handling:
button.addEventListener('click', () => {
alert('Button Clicked');
});
-
Array Methods:
-
map()
,filter()
,reduce()
,forEach()
-
const arr = [1, 2, 3];
const doubled = arr.map(num => num * 2);
React.js (Basics)
- Creating a Component:
import React from 'react';
const MyComponent = () => {
return <div>Hello React!</div>;
};
export default MyComponent;
- JSX Syntax:
return (
<div>
<h1>Hello</h1>
<p>World</p>
</div>
);
- State and Props:
const [count, setCount] = useState(0); // useState hook
<MyComponent propName="value" /> // Passing Props
- useEffect Hook:
useEffect(() => {
// Runs after component renders
}, [dependencies]); // Rerun based on dependencies
Version Control (Git)
-
Basic Commands:
-
git init
- Initialize repository -
git status
- Check current status -
git add .
- Stage all changes -
git commit -m "Message"
- Commit changes -
git push
- Push to remote repository -
git pull
- Fetch updates
-
Common Tools
-
npm (Node Package Manager) Commands:
-
npm install <package>
- Install a package -
npm start
- Start the application
-
-
Code Formatter:
- Prettier - Auto-format code
- ESLint - Linting to catch potential errors
devjournal Article's
30 articles in total
DRY
read article
Maximizing Productivity: The Benefits of Planning Your Day as a Software Engineer
read article
GitHub as a CMS
read article
npx life@2024 preview: How Missing Flights, Finding Love, and Building Svelte Apps Changed Everything
read article
[Boost]
read article
366 days of launch weeks
read article
How to Enhance Notion Templates with AI for Smarter Workflows
read article
Retroโing and Debugging 2024 - A year of learning and fun
read article
Title: Coffee Sales Order Analysis with Excel: Dashboard, Pivot Table & Insights
read article
Week 1-4
read article
Day 01 , what did learn
currently reading
The Mind Is A Stateless Machine
read article
Learning in Reverse: How I Would Learn ASP. Net Core and Entity Framework If I Could Go Back In Time
read article
33rd day of my CP journey
read article
55th day of my CP journey
read article
59th day of my CP journey
read article
How My Old Laptop Taught Me More About Coding Than Any Course Ever Could
read article
Initial commit
read article
AWS Community: How User Groups Transformed My Cloud Career
read article
I Got A Perfect (100%) Score in My College-Level Python Course!
read article
Exploring the when guards feature in Kotlin 2.1
read article
My December Adventure (of code)
read article
A Promising Vision For Redefining The Way People Build...
read article
โก๏ธThe Best Postman Alternative for IntelliJ Every Developer Will Want to Know! ๐ฅ
read article
๐ฏ Track, Plan, Succeed: A Guide to 2025 Goal-Setting
read article
</2024>
read article
Our external realities have advanced far more than our internal cognitive level...
read article
CREATING AGELESS CONTENT
read article
I built a library of code snippets for developers
read article
Frequently asked questions on launch weeks
read article
Featured ones: