Skip to content

Instantly share code, notes, and snippets.

View dSalieri's full-sized avatar
๐Ÿ˜’
Dark guardian always there!

dSalieri

๐Ÿ˜’
Dark guardian always there!
View GitHub Profile
@DmitriiNazimov
DmitriiNazimov / pattern-flyweight.js
Created August 27, 2019 20:33
[JS ES6 ะŸะฐั‚ั‚ะตั€ะฝ ะŸะ ะ˜ะกะŸะžะกะžะ‘ะ›ะ•ะะ•ะฆ/ะ›ะ•ะ“ะšะžะ’ะ•ะก (Flyweight)] #js #ES6 #ะžะžะŸ #ะŸะฐั‚ั‚ะตั€ะฝั‹
/**
*
* ะŸะะขะขะ•ะ ะ ะŸะ ะ˜ะกะŸะžะกะžะ‘ะ›ะ•ะะ•ะฆ/ะ›ะ•ะ“ะšะžะ’ะ•ะก (Flyweight)
*
* ะŸะฐั‚ั‚ะตั€ะฝ ะŸะ ะ˜ะกะŸะžะกะžะ‘ะ›ะ•ะะ•ะฆ/ะ›ะ•ะ“ะšะžะ’ะ•ะก - ัั‚ั€ัƒะบั‚ัƒั€ะฝั‹ะน ัˆะฐะฑะปะพะฝ ะฟั€ะพะตะบั‚ะธั€ะพะฒะฐะฝะธั, ะฟั€ะธ ะบะพั‚ะพั€ะพะผ ะพะฑัŠะตะบั‚, ะฟั€ะตะดัั‚ะฐะฒะปััŽั‰ะธะน ัะตะฑั ะบะฐะบ
* ัƒะฝะธะบะฐะปัŒะฝั‹ะน ัะบะทะตะผะฟะปัั€ ะฒ ั€ะฐะทะฝั‹ั… ะผะตัั‚ะฐั… ะฟั€ะพะณั€ะฐะผะผั‹, ะฟะพ ั„ะฐะบั‚ัƒ ะฝะต ัะฒะปัะตั‚ัั ั‚ะฐะบะพะฒั‹ะผ.
* ะ”ะฐะฝะฝั‹ะน ะฟะฐั‚ั‚ะตั€ะฝ ะฟั€ะพะตะบั‚ะธั€ะพะฒะฐะฝะธั ะฟะพะทะฒะพะปัะตั‚ ะฒะผะตัั‚ะธั‚ัŒ ะฑะพะปัŒัˆะตะต ะบะพะปะธั‡ะตัั‚ะฒะพ ะพะฑัŠะตะบั‚ะพะฒ ะฒ ะพั‚ะฒะตะดั‘ะฝะฝัƒัŽ ะพะฟะตั€ะฐั‚ะธะฒะฝัƒัŽ ะฟะฐะผัั‚ัŒ.
* ะ›ะตะณะบะพะฒะตั ัะบะพะฝะพะผะธั‚ ะฟะฐะผัั‚ัŒ, ั€ะฐะทะดะตะปัั ะพะฑั‰ะตะต ัะพัั‚ะพัะฝะธะต ะพะฑัŠะตะบั‚ะพะฒ ะผะตะถะดัƒ ัะพะฑะพะน, ะฒะผะตัั‚ะพ ั…ั€ะฐะฝะตะฝะธั ะพะดะธะฝะฐะบะพะฒั‹ั… ะดะฐะฝะฝั‹ั… ะฒ
* ะบะฐะถะดะพะผ ะพะฑัŠะตะบั‚ะต.
@bradtraversy
bradtraversy / mongodb_cheat_sheet.md
Last active April 16, 2025 20:59
MongoDB Cheat Sheet

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@jakub-g
jakub-g / async-defer-module.md
Last active March 24, 2025 07:50
async scripts, defer scripts, module scripts: explainer, comparison, and gotchas

<script> async, defer, async defer, module, nomodule, src, inline - the cheat sheet

With the addition of ES modules, there's now no fewer than 24 ways to load your JS code: (inline|not inline) x (defer|no defer) x (async|no async) x (type=text/javascript | type=module | nomodule) -- and each of them is subtly different.

This document is a comparison of various ways the <script> tags in HTML are processed depending on the attributes set.

If you ever wondered when to use inline <script async type="module"> and when <script nomodule defer src="...">, you're in the good place!

Note that this article is about <script>s inserted in the HTML; the behavior of <script>s inserted at runtime is slightly different - see Deep dive into the murky waters of script loading by Jake Archibald (2013)

@faressoft
faressoft / dom_performance_reflow_repaint.md
Last active February 10, 2025 17:21
DOM Performance (Reflow & Repaint) (Summary)

DOM Performance

Rendering

  • How the browser renders the document
    • Receives the data (bytes) from the server.
    • Parses and converts into tokens (<, TagName, Attribute, AttributeValue, >).
    • Turns tokens into nodes.
    • Turns nodes into the DOM tree.
  • Builds CSSOM tree from the css rules.

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@gaearon
gaearon / connect.js
Last active April 22, 2025 06:40
connect.js explained
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (
@paulirish
paulirish / what-forces-layout.md
Last active April 19, 2025 04:59
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@trevnorris
trevnorris / uv-loop-notes.txt
Last active July 27, 2024 09:30
rough notes on the linux side of the libuv event loop
uv_run
- uv__update_time(): Update time with millisecond precision.
- uv__run_timers(): Loop through "heap" and run timers whose timeout > time.
- uv__run_pending(): Run all callbacks on the pending_queue. Remove each item
from the queue when run.
@rxaviers
rxaviers / gist:7360908
Last active April 22, 2025 01:30
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue: