Skip to content

Instantly share code, notes, and snippets.

@dartess
dartess / html
Created October 3, 2018 20:30
form-demo
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Form demo</title>
</head>
<body>
<form class="form" method="POST">
var browsers = [
['Google Chrome', 57],
['Chrome Mobile', 57],
['Яндекс.Браузер', 18],
['Mobile Safari', 11],
['Firefox', 50],
['Opera', 44],
['Samsung Internet', 7],
['MSIE', 9999],
['Edge', 17],
@dartess
dartess / RangesManager.test.ts
Created March 31, 2022 07:20
Ranges Manager
import { RangesManager } from '../RangesManager';
/*
About test cases:
There are three equivalence classes with respect to any range.
Using the range from 5 to 10 as an example (or [5; 10])
- to the left of the range: [-∞; 4]
- the range itself: [5; 10]
- to the right of the range: [11; ∞]
import * as React from 'react';
export const MemoryUsage = () => {
const [percent, setPercent] = React.useState<string | number>('-');
const color = (() => {
if (typeof percent === 'string') {
return 'white';
}
if (percent < 50) {
@dartess
dartess / caseInsensitiveProxy.test.ts
Created April 29, 2022 13:43
caseInsensitiveProxy
import { caseInsensitiveProxy } from '../caseInsensitiveProxy';
describe('caseInsensitiveProxy', () => {
it('set and get', () => {
const proxy = caseInsensitiveProxy<Record<string, unknown>>();
proxy.someValue = 1;
expect(proxy.someValue).toBe(1);
expect(proxy.SomeValUE).toBe(1);
expect(proxy.somevalue).toBe(1);
/**
* @fileoverview The default export should include type checking using `satisfy Meta`
* @author Sergey Kozlov
*/
"use strict";
module.exports = {
/**
* @type { import('eslint').Rule.RuleMetaData }
*/