Web Development CS JS Python JavaScript Hacking ReactJs Python django Flask CSS Frontend Backend Full Stack Java Node Pdf Books
3.99K subscribers
878 photos
11 videos
995 files
354 links
One place for the latest in JavaScript, Python, Django, React, and more. Get top-notch tutorials, tips, and downloadable resources. Join us to elevate your tech skills!
Download Telegram
You're at a web development interview.💨

The interviewer asked:

"What is a web server and how does it play a crucial role in web development? ."

Here's how to answer:👇👇

A web server is the bridge in client-server communication.

It:
handles requests,
retrieves resources, and
ensures efficient data transfer.

Web servers fetch requested content from storage and send it back to the user's browser.

They use HTTP/HTTPS to communicate, manage security and maintain data integrity.

@javascript_resources
@python_assets
🔥3👍1
𝗧𝗼𝗽 𝟮𝟬 𝗦𝗤𝗟 𝗾𝘂𝗲𝗿𝘆 𝗼𝗽𝘁𝗶𝗺𝗶𝘇𝗮𝘁𝗶𝗼𝗻 𝘁𝗲𝗰𝗵𝗻𝗶𝗾𝘂𝗲𝘀

Here is the list of the top 20 SQL query optimization techniques I found noteworthy:

1. Create an index on huge tables (>1.000.000) rows
2. Use EXIST() instead of COUNT() to find an element in the table
3. SELECT fields instead of using SELECT *
4. Avoid Subqueries in WHERE Clause
5. Avoid SELECT DISTINCT where possible
6. Use WHERE Clause instead of HAVING
7. Create joins with INNER JOIN (not WHERE)
8. Use LIMIT to sample query results
9. Use UNION ALL instead of UNION wherever possible
10. Use UNION where instead of WHERE ... or ... query.
11. Run your query during off-peak hours
12. Avoid using OR in join queries
14. Choose GROUP BY over window functions
15. Use derived and temporary tables
16. Drop the index before loading bulk data
16. Use materialized views instead of views
17. Avoid != or <> (not equal) operator
18. Minimize the number of subqueries
19. Use INNER join as little as possible when you can get the same output using LEFT/RIGHT join.
20. Frequently try to use temporary sources to retrieve the same dataset.

Do you know what is 𝗤𝘂𝗲𝗿𝘆 𝗢𝗽𝘁𝗶𝗺𝗶𝘇𝗲𝗿? Its primary function is to determine 𝘁𝗵𝗲 𝗺𝗼𝘀𝘁 𝗲𝗳𝗳𝗶𝗰𝗶𝗲𝗻𝘁 𝘄𝗮𝘆 to execute a given SQL query by finding the best execution plan. The query optimizer takes the SQL query as input and analyzes it to determine how best to execute it. The first step is to parse the SQL query and create a syntax tree. The optimizer then analyzes the syntax tree to determine how to run the query.

Next, the optimizer generates 𝗮𝗹𝘁𝗲𝗿𝗻𝗮𝘁𝗶𝘃𝗲 𝗲𝘅𝗲𝗰𝘂𝘁𝗶𝗼𝗻 𝗽𝗹𝗮𝗻𝘀, which are different ways of executing the same query. Each execution plan specifies the order in which the tables should be accessed, the join methods, and any filtering or sorting operations. The optimizer then assigns a 𝗰𝗼𝘀𝘁 to each execution plan based on the number of disk reads and the CPU time required to execute the query.

Finally, the optimizer 𝗰𝗵𝗼𝗼𝘀𝗲𝘀 𝘁𝗵𝗲 𝗲𝘅𝗲𝗰𝘂𝘁𝗶𝗼𝗻 𝗽𝗹𝗮𝗻 with the lowest cost as the optimal execution plan for the query. This plan is then used to execute the query.
1
Complete HTML in 2 Minutes🔥

Here we go👇

1.Document Structure
• <!DOCTYPE>
• <html>
• <head>
• <title>
• <meta>
• <link>
• <script>
• <noscript>

2.Text Content
• <h1>, <h2>, <h3>, <h4>, <h5>, <h6>
• <p>
• <span>
• <strong>
• <em>
• <br>
• <hr>

3.Lists
• <ul>
• <ol>
• <li>
• <dl>
• <dt>
• <dd>

4.Links and Navigation
• <a>
• <nav>
• <link>

5.Embedded Content
• <img>
• <audio>
• <video>
• <iframe>
• <canvas>
• <svg>

6.Forms
• <form>
• <input>
• <textarea>
• <button>
• <select>
• <option>
• <label>
• <fieldset>
• <legend>
• <datalist>
• <output>

7.Tables
• <table>
• <tr>
• <th>
• <td>
• <caption>

8.Semantic Elements
• <article>
• <section>
• <header>
• <footer>
• <aside>
• <main>
• <figure>
• <figcaption>
• <mark>
• <progress>
• <time>
• <details>
• <summary>

9.Deprecated Elements (Avoid Using)
• <center>
• <font>
• <strike>


@javascript_resources
@python_assets
3
As web developer, you need to master writing API.

And a common question I got asked is: what is 'RESTful' API? 🤔

Here's a mega thread about RESTful API and how to write it:

First of all, REST stands for 'REpresentational State Transfer', it is an architectural style of writing API.

It includes the following 6 features:
1. Uniform interface

The API should be written with unique and consistent methods of resource identification and manipulation, with clear messages to define actions and information.

(continue 👇)

2. Client-server architecture 🛎️

The principle of 'Separation of concerns' is applied here - we want to separate the user interface vs. data storage.

(continue 👇)


3. Statelessness 📍

Each request must already contain all knowledge needed to complete the request.

(continue 👇)


4. Cacheability 📥

Allowing identification of cacheable contents, and to avoid stale or inappropriate data.

(continue 👇)

5. Layered system 🍰

There should be hierarchical layers of components, without affecting communication between client and server (e.g., proxy and load balancers).

(continue 👇)


6. Code-on-demand (optional) 👩‍💻

Executable code can be sent from server to provide extra temporary functionalities,

(continue 👇)


Here's some common pattern of RESTful API:

📌 List container contents: GET /items
📌 Add an item to container: POST /items
- with item in request
- URI of item returned in HTTP response header, e.g. Location: http://host/items/itemid

(cont'd) 👇


📌 Retrieve an item: GET /items/itemid
📌 Update an item: PUT /items/itemid
- with updated item in request
📌 Delete an item: DELETE /items/itemid

(cont'd)


In a nutshell, a well written RESTful API is:

Easy to work with
Uniformed
Scripting language friendly


@javascript_resources
@python_assets
👍1👏1
HTML tip:

You can use the download attribute in your links to download the file instead of navigating to it:
Check out these 15 fascinating Free (public) APIs:

👩 Genderize .io
🔍 IMDb API
📦 Dropbox API
🚀 NASA API
📱 Twilio API
🌤️ OpenWeatherMap API
🍔 Open food facts
💬 Slack API
🐙 GitHub API
👕 Shopify API
💰 PayPal API
💳 Stripe API
🤖 Reddit API
📂 OneDrive API
🦠 VirusTotal API

@javascript_resources
@python_assets
A-Z Git in 2 minutes 🔥

here we go👇

1. Core:
• git init
• git clone
• git add
• git commit
• git status
• git diff
• git checkout
• git reset
• git log
• git show
• git tag
• git push
• git pull

2.Branching:
• git branch
• git checkout -b
• git merge
• git rebase
• git branch --set-upstream-to
• git branch --unset-upstream
• git cherry-pick

3.Merging:
• git merge
• git rebase

4.Stashing:
• git stash
• git stash pop
• git stash list
• git stash apply
• git stash drop

5.Remotes:
• git remote
• git remote add
• git remote remove
• git fetch
• git pull
• git push
• git clone --mirror

6.Configuration:
• git config
• git global config
• git reset config

7. Plumbing:
• git cat-file
• git checkout-index
• git commit-tree
• git diff-tree
• git for-each-ref
• git hash-object
• git ls-files
• git ls-remote
• git merge-tree
• git read-tree
• git rev-parse
• git show-branch
• git show-ref
• git symbolic-ref
• git tag --list
• git update-ref

8.Porcelain:
• git blame
• git bisect
• git checkout
• git commit
• git diff
• git fetch
• git grep
• git log
• git merge
• git push
• git rebase
• git reset
• git show
• git tag

9.Alias:
• git config --global alias.<alias> <command>

10.Hook:
• git config --local core.hooksPath <path>

11.Experimental: (May not be fully Supported)
• git annex
• git am
• git cherry-pick --upstream
• git describe
• git format-patch
• git fsck
• git gc
• git help
• git log --merges
• git log --oneline
• git log --pretty=
• git log --short-commit
• git log --stat
• git log --topo-order
• git merge-ours
• git merge-recursive
• git merge-subtree
• git mergetool
• git mktag
• git mv
• git patch-id
• git p4
• git prune
• git pull --rebase
• git push --mirror
• git push --tags
• git reflog
• git replace
• git reset --hard
• git reset --mixed
• git revert
• git rm
• git show-branch
• git show-ref
• git show-ref --heads
• git show-ref --tags
• git stash save
• git subtree
• git tag --delete
• git tag --force
• git tag --sign
• git tag -f
• git tag -l
• git tag --verify
• git unpack-file
• git update-index
• git verify-pack
• git worktree

------------------- END ------------------
👍2
HTML Tip💡
@javascript_resources
@python_assets

You can use the "loading" attribute with the <img> element to control how the browser loads the image.

It has three values: "eager", "lazy", and "auto".
👍1