Skip to content

Instantly share code, notes, and snippets.

View DRublev's full-sized avatar
🔥
Hot, but not fixed

Daniil Rublev DRublev

🔥
Hot, but not fixed
View GitHub Profile
@DRublev
DRublev / chache_holyjs26
Last active May 13, 2026 06:55
Ссыли из доклада Кеширование данных на максималках | Даниил Рублев | HolyJS26
Кеширование в NextJs - https://nextjs.org/docs/app/guides/caching#data-cache
nodejs/undici - https://github.com/nodejs/undici?tab=readme-ov-file#using-cache-interceptor
DataLayer - https://github.com/uniksssss/data-storage-system/tree/dev/src/domain
На правах рекламы, мой тг канал - https://t.me/coaled_frontender
function isGeolocationSupported() {
return !!("geolocation" in navigator);
}
function isDragAndDropSupported() {
return !!Modernizr.draganddrop;
}
function isFlexSupported() {
const testElem = document.createElement("div");
@DRublev
DRublev / arrayExtensions.js
Created December 21, 2021 08:31
Helpers for Array (without prototype reassignment)
/**
* Find last entry of an element that matches predicate
* @description O(n)
* @param {Array} array
* @param {Function} predicate
* @returns Latest element that matches predicate or null if none found
*/
export const lastArrayEntry = (array = [], predicate = () => false) => {
if (!Array.isArray(array)) throw new Error('lastArrayEntry - array is not a type of Array');
if (!predicate || typeof predicate !== 'function') throw new Error('lastArrayEntry - predicate is not a function');
@DRublev
DRublev / DebugAssert.ts
Created November 30, 2021 07:35
Assert like C#
import { CustomError, StatusCode } from '../error';
/** NOTE: Now it is not actually used */
export interface IDebugAssertOptions {
log?: boolean
throw?: boolean;
failOnUnhandledError?: boolean;
}