Love Coding
A blog focused on programming, debugging, and refactoring real-world code
function deploySafely()
if (isFriday()) {
console.warn(“Do not touch production.”);
return;
}
deploy();
}
Code is like a joke. If you have to explain it, it’s bad.
Practical code
Quick coding tips
Boost Scroll Performance with passive: true
Make scroll or touch listeners more performant – tell the browser you won’t call preventDefault()
window.addEventListener(
'scroll',
onScroll,
{ passive: true }
);
Destructure and Keep the Rest
You can combine destructuring and rest syntax to extract what you need and keep the rest.
const { id, ...info } = { id: 1, name: "Alice", role: "Admin" };
console.log(info); // { name: "Alice", role: "Admin" }
Run an Event Listener Just Once
You can make an event listener run only once – it removes itself automatically after the first trigger.
button.addEventListener(
'click',
handler,
{ once: true }
);
Categories
CSS
Styling tips and techniques to create beautiful, responsive web designs
7 postsFront-end Developer Tools
Essential tools and workflows to boost your front-end productivity.
2 postsHTML
Best practices for writing clean, accessible, and semantic markup
12 postsJavaScript
Modern guides and tips for dynamic, interactive web development
3 postsLinux
Developer-focused tutorials for mastering Linux and the command line
1 postPHP
Practical tips for building powerful and secure web applications
4 postsProgrammers mindset
Improve your problem-solving, focus, and growth as a developer
0 postsPrzykładowe projekty juniora
7 postsReact
Learn to build fast, reusable UI components with React
12 postsReact Native
Guides to creating cross-platform mobile apps with React Native
4 postsWordPress Development
Advanced tips for customizing and optimizing WordPress sites
Blog
Latest posts
React Hooks – useReducer hook example
UseReducer is an alternative to useState. It works better when you have complex state logic that involves multiple sub-values (e.g….
React Hooks – useState hook example
Hooks are a new functionality of React, thanks to which we can “hook into” React features, which makes writing applications…
CSS text-decoration property and new styles 2019
New styles, tags, functionalities – this is what tiggers like best 🙂 In this post I will show you how…
Styling chosen links on site, e.g only links to PDF file
In previous post: styling lists with pseudo-classes I described how to change the color of active, clicked or hovered links….
Styling links with css
Standard appearance of hyperlinks on a website depends on the browser. Each browser can display links and their variants (with…
Basic git commands
You can perform git commands for example in: – cmd console (widnows start -> cmd. It should oppened Command Prompt…
Category
JavaScript
Category
Front-end Developer Tools
Category
Linux
Category