Skip to content

Instantly share code, notes, and snippets.

View faiwer's full-sized avatar

Stepan Zubashev faiwer

View GitHub Profile
@faiwer
faiwer / idb.ts
Created September 24, 2025 13:27
idb.ts
import debounce from 'lodash-es/debounce';
import {
catchError,
combineLatest,
defer,
filter,
map,
Observable,
of,
shareReplay,
/* eslint-disable @typescript-eslint/no-non-null-assertion -- ignore it. */
/* eslint-disable @typescript-eslint/no-unused-vars -- ignore it. */
/* eslint-disable simple-import-sort/imports -- ignore it. */
import { act, renderHook, render } from '@testing-library/react';
import { useEffect, useState, useSyncExternalStore } from 'react';
it('test', () => {
const store = new Store<State>({
id: '1',
articles: { 1: { title: '1' } },
const kittens = [];
for(const cat of cats)
{
if(cat.months < 7)
{
kittens.push(cat.name);
if(kittens.length === limit)
break;
}
}
#!/bin/bash
### BEGIN INIT INFO
# Provides: %name%
# Required-Start: $network $remote_fs $local_fs
# Required-Stop: $network $remote_fs $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: forever-service startup script for %name%
# Description: forever-service startup script for node script based service %name%, uses forever to start the service
const { Suite } = require("benchmark");
const Random = require("random-js");
const { map, into, compose, filter, take, pluck } = require("ramda");
const suite = new Suite();
const random = new Random();
function present({ name, hz, count }) {
console.log(
`
the = 4144
and = 2193
to = 2042
a = 1812
of = 1656
harry = 1516
he = 1402
was = 1266
said = 1218
his = 1169
(function()
{
"use strict";
let limit = 100000;
class A1
{
a1(){ return '1'; }
b1(){ return 1; }
(function()
{
"use strict";
function test(label, co)
{
let times = 3000;
function * g1(){ return 1; }
function * g2()
{
Traceback (most recent call last):
File "/home/faiwer/po/sublime_text_3/sublime_plugin.py", line 524, in run_
return self.run(**args)
TypeError: run() got an unexpected keyword argument 'regex_exclude'