Как стать автором
Обновить
4
0
Sergey Leschev ✓⃝ @Leschev

System Architect | Team Lead | CTO

Отправить сообщение

React Custom Hook: useDarkMode

Уровень сложностиСредний
Время на прочтение4 мин
Количество просмотров2.6K

One of the main advantages of "useDarkMode" is its simplicity. With just a few lines of code, you can enable dark mode in your React application. By invoking this hook, you'll receive the current dark mode state and a function to toggle it.

The "useDarkMode" hook dynamically updates the HTML body class to apply the "dark-mode" styling whenever dark mode is enabled. This approach ensures consistency across all components without the need for manual class manipulation.

Read more
Всего голосов 4: ↑2 и ↓2+2
Комментарии0

React Custom Hook: useCopyToClipboard

Уровень сложностиСредний
Время на прочтение2 мин
Количество просмотров1.9K

Copying text to the clipboard in a React application can be a tedious task. To simplify this process, I've created a powerful custom hook called useCopyToClipboard. With just a few lines of code, this hook streamlines the copy-to-clipboard functionality, providing developers with a hassle-free solution.

Read more
Рейтинг0
Комментарии0

React Custom Hook: useCookie

Уровень сложностиСредний
Время на прочтение4 мин
Количество просмотров3.7K

One of the key advantages of this custom hook is the ability to update the cookie value. The updateCookie function, returned by useCookie, enables you to modify the value of the cookie. By invoking this function with a new value and optional options, such as expiration or path, you can instantly update the cookie.

Read more
Рейтинг0
Комментарии0

React Custom Hook: useClickOutside

Уровень сложностиСредний
Время на прочтение2 мин
Количество просмотров3.6K

The potential applications for useClickOutside are endless. It is particularly useful when implementing modal windows, dropdown menus, or any element that should be closed when a user interacts with anything outside of it. By incorporating useClickOutside, you can enhance the user experience by providing intuitive and efficient interactions.

Read more
Рейтинг0
Комментарии3

React Custom Hook: useAsync

Уровень сложностиСредний
Время на прочтение2 мин
Количество просмотров3.5K

By utilizing useAsync, you can streamline your React codebase, enhance reusability, and maintain a consistent and reliable user experience. Give it a try in your next React project and witness the power of simplified asynchronous operations.

Read more
Рейтинг0
Комментарии0

React Custom Hook: useArray

Уровень сложностиСредний
Время на прочтение2 мин
Количество просмотров6.5K

In this article series, we embark on a journey through the realm of custom React hooks, discovering their immense potential for elevating your development projects. Our focus today is on the "useArray" hook, one of the many carefully crafted hooks available in the collection of React custom hooks.

Read more
Рейтинг0
Комментарии0

LeetCode 2532 (Hard++, Extra Category, Amazon). Time to Cross a Bridge. Swift solution

Уровень сложностиСложный
Время на прочтение5 мин
Количество просмотров1.2K

Hard++, Extra Category.

Amazon.

Overflow checks have been taken into consideration. The maximum time to move a box is at most 4 * 1000 (four steps to move the box, each taking 1000 time). With at most 1e4 boxes, the total time is at most 4e7, ensuring the solution is safe.

Read more
Рейтинг0
Комментарии0

iOS Dev Skills. Performance Review

Время на прочтение2 мин
Количество просмотров1.1K

CTO: Balancing Leadership and Architecture.

As a CTO, effective leadership goes beyond technical architecture. Conducting regular performance reviews is a crucial part of managing teams.

Note: The performance review schedule may vary depending on the specific
company's policies and guidelines.

For early-stage startups, lacking CTO expertise in conducting performance reviews is common. In my experience, I've tailored grades to encompass all aspects of professional iOS development, keeping project-specific needs in mind. Being the first in the team can offer significant growth opportunities. However, acknowledging any lack of people management skills and compensating through continuous growth is essential.

I've compiled my insights on structuring the iOS development department, conducting performance reviews, and most importantly, emphasizing the significant distinctions between developers' levels based on well-defined criteria.

Read more
Рейтинг0
Комментарии0

LeetCode 2801 (Hard, Acceptance 14.5%). Count Stepping Numbers in Range. DP. Handles large inputs (10^9 + 7)

Уровень сложностиСредний
Время на прочтение3 мин
Количество просмотров724

Given two positive integers low and high represented as strings, find the count of stepping numbers in the inclusive range [low, high].

A stepping number is an integer such that all of its adjacent digits have an absolute difference of exactly 1.

Return an integer denoting the count of stepping numbers in the inclusive range [low, high].

Since the answer may be very large, return it modulo 10^9 + 7.

Hard, Acceptance Level 14.5%.
Dynamic Programming (DP).
Efficiently handles large inputs (10^9 + 7).

Latest and Most Hardest Problem.

Read more
Рейтинг0
Комментарии0

LeetCode 2790 (Hard). Maximum Number of Groups With Increasing Length. Solution of the day. O(N logN). Math

Уровень сложностиСредний
Время на прочтение3 мин
Количество просмотров1.3K

Simple Swift Math Solution.

Time complexity: O(N logN).

The time complexity of this solution is dominated by the sorting step, making it O(N logN), where N is the length of the input array usageLimits. The rest of the operations involve simple arithmetic and comparisons, which take linear time. Therefore, the overall time complexity of the function is O(NlogN).

Only 10 lines of code.

Read more
Рейтинг0
Комментарии0

Supercharge Your React Projects with Custom Hooks

Уровень сложностиСредний
Время на прочтение42 мин
Количество просмотров9.4K

In this article, we dive into the world of custom React hooks and explore the incredible potential they hold for supercharging your work projects. With over 20 carefully crafted hooks at your disposal, I personally utilize these hooks in my own work projects, and now I'm excited to share them with you. From enhancing functionality to streamlining workflows, these custom hooks are designed to empower developers and deliver user-friendly experiences. Join us on this journey as we unleash the power of these 20+ hooks and unlock new levels of productivity and innovation in your React projects.

Read more
Всего голосов 1: ↑1 и ↓0+1
Комментарии2

LeetCode 2612 (Hard). Minimum Reverse Operations. Swift. BFS. O(n+k). O(n)

Уровень сложностиСложный
Время на прочтение3 мин
Количество просмотров1.6K

LeetCode 2612 (Hard). Minimum Reverse Operations.

The algorithm follows a breadth-first search (BFS) approach to determine the minimum number of reverse operations needed to bring the 1 to each position in the array.

To speed up the algorithm, we mark banned positions with -2 instead of using set lookups. This optimization reduces the constant coefficient and improves the speed of the algorithm, but it may still result in a time limit exceeded (TLE) error.

For each visited position, there are potentially O(k) target positions that can be reached through reverse operations. To avoid the multiplicative cost of iterating over all these potential positions, we update the nextNode2s array. This array initially points forward by 2, but we update it dynamically to point beyond all the target positions considered for each visited position. This optimization helps improve the efficiency of the algorithm and avoids unnecessary computations.

Read more
Всего голосов 2: ↑2 и ↓0+2
Комментарии0

LeetCode 956 (Hard). Solution of the day. Tallest Billboard. Swift. DP

Уровень сложностиСложный
Время на прочтение2 мин
Количество просмотров2.4K

Solution of the day.
LeetCode 956 (Hard). Tallest Billboard.

The code uses dynamic programming to solve the problem. It maintains a dictionary dp, where the keys represent the possible height differences between the two billboards, and the values represent the maximum sum of heights achieved for each height difference.

Read more
Всего голосов 3: ↑2 и ↓1+2
Комментарии0

Array of weak in Swift

Уровень сложностиСредний
Время на прочтение2 мин
Количество просмотров5.2K

In Swift, when working with objects, it’s important to manage memory correctly. One way to do this is by using weak references to avoid retaining objects too long and causing memory leaks. In this article, we will discuss how to create an array of weak references in Swift using a generic wrapper.

Read more
Всего голосов 1: ↑1 и ↓0+1
Комментарии0

SwiftUI & ChatGPT. The world is changing. Again

Уровень сложностиПростой
Время на прочтение4 мин
Количество просмотров3K

Everything that follows from this point forward input prompts, followed by ChatCGP’s responses, complete with sample code in Swift.

> Hey ChatGPT, can you make a SwiftUI registration form with name, address and city fields?

Read more
Всего голосов 5: ↑4 и ↓1+3
Комментарии1

Swift 5.7: Regex. Shorthands for optional unwrapping. Unlock existentials for all protocols

Уровень сложностиСредний
Время на прочтение3 мин
Количество просмотров1.1K

Swift 5.7: Regex. Shorthands for optional unwrapping. Unlock existentials for all protocols.

Shorthands for optional unwrapping. Improved type inference for complex closures. Better string parsing with Swift Regex. Creating a Regex with Regex literal. Creating a Regex using RegexBuilder. Unlock existentials for all protocols.

Read more
Рейтинг0
Комментарии0
2

Информация

В рейтинге
Не участвует
Дата рождения
Зарегистрирован
Активность

Специализация

Fullstack Developer, Mobile Application Developer
Lead
SWIFT
SwiftUI
TypeScript
Node.js
React
JavaScript
SQL
PostgreSQL
DevOps
React Native