Skip to content

Instantly share code, notes, and snippets.

@readyyyk
readyyyk / generate.ts
Created August 10, 2025 19:26
Generate color tons
const sum = (...args: number[]) => args.reduce((a, e) => a + e, 0);
const htd = (s: string): number => parseInt(s, 16);
const dth = (v: number): string => (v.toString(16).length === 1 ? `0${v.toString(16)}` : v.toString(16));
type TResult = Record<number, [number, number, number]>;
const normalizeResult = (r: TResult): TResult => {
// skip 000 n fff
const result = structuredClone(r);
delete result[0];
const NALOG = 0.13; // подоходный
const ADD = true; // пополняемый?
const CAP = true; // always true in calc (капитализация)
const RATE = 0.14;
const MONTH = 26;
const INIT_SUM = 3000;
const ADD_SUM = 1000;
const RAW = INIT_SUM + ADD_SUM * MONTH;
@readyyyk
readyyyk / urls.csv
Last active April 30, 2025 16:32
FlatCrawl URL Database
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 10 columns, instead of 4 in line 7.
id,source,cost,url,dateAdded,seen,ok,called,active,archived
1,realt,320,https://realt.by/rent-flat-for-long/object/3687766/,1743358177,false,false,false,false,true
2,realt,350,https://realt.by/rent-flat-for-long/object/3687744/,1743358177,true,true,false,true,true
3,realt,370,https://realt.by/rent-flat-for-long/object/3677748/,1743358177,true,true,false,true,true
4,kufar,320,https://re.kufar.by/vi/minsk/snyat/kvartiru-dolgosrochno/1012313473?rank=0&searchId=f2191ef2ca1a704d776c738511b109ddfae0,1743358182,false,false,false,false,true
5,kufar,400,https://re.kufar.by/vi/minsk/snyat/kvartiru-dolgosrochno/1009843177?rank=1&searchId=f2191ef2ca1a704d776c738511b109ddfae0,1743358182,true,true,false,false,true
6,kufar,351,https://re.kufar.by/vi/minsk/snyat/kvartiru-dolgosrochno/v-novostrojke/1012311161?rank=2&searchId=f2191ef2ca1a704d776c738511b109ddfae0,1743358182,true,true,true,true,true
7,kufar,400,https://re.kufar.by/vi/minsk/snyat/kvartiru-dolgosrochno/v-novostrojke/1011607216?rank=3&searchId=f2191ef2ca1a704d776c7
<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<!-- created with Free Online Sitemap Generator www.xml-sitemaps.com -->
<url>
type X<T> = (a: T) => T
const compose = <T,>(subj: T, ...funcs: ((a: T)=>T)[]): T => funcs.reduceRight((prev, cur)=>cur(prev), subj);
const tap = <T,>(cb:X<T>): X<T> => (a)=>{cb(a);return a;};
const ifElse = <T,>(cond:X<T>, onS:X<T>, onF:X<T>): X<T> => (a) => cond(a) ? onS(a) : onF(a);

Если вы снижаете оценку - добавьте поле Комментарий после оценки. Например:

| Критерий         |   Макс.   | Моя оценка | Комментарий            |
|------------------|:---------:|:----------:|------------------------|
| Стать счастливым | 5 баллов. |     4      | У тебя еще нет оффера! |

Review

/** @param {string} data */
function make(data) {
let str = data
.split("\n")
.filter(line => line.trim() !== "")
.join("\n");
str = str.replaceAll("}", "");
str = str.replaceAll(/[\t ]*interface (\w+) \{/g, "@typedef {Object} $1");
str = str.replaceAll(/[\t ]*type (\w+) = \{/g, "@typedef {Object} $1");

AC - already created

MB - make better

  1. AC Dynamic API-keys (access-refres key rotation)
  2. AC System for managing timeout for lamda (already implemented)
  3. MB M-Log (centralized logging system).
    • Introduce high-level API & SDKs for logging to centralized system
  4. AC Store all updates and updated data in KV-store and batch update primary DB (Already implemented - db cache)