Skip to content

Instantly share code, notes, and snippets.

View sergeysova's full-sized avatar
👋
Open to network

Sova sergeysova

👋
Open to network
View GitHub Profile
@sergeysova
sergeysova / disposable.ts
Created August 9, 2024 19:45 — forked from 7iomka/disposable.ts
Disposable
/* eslint-disable consistent-return */
/* eslint-disable effector/mandatory-scope-binding */
/* eslint-disable effector/no-watch */
import type { Node } from 'effector';
import {
clearNode,
attach,
// combine,
createEffect,
createNode,
export function WorkspacePaneTable(
props: WorkspacePaneProps<Workspace.WorkspaceItemHeaderTable>
) {
let [selectedId, setSelectedId] = React.useState<Data.Id | null>(null);
let catalog = Recoil.useRecoilValue(Data.$catalog);
let table = catalog.schema_tables[props.item.name];
let query = React.useMemo(() => createQuery(table), [table]);
let panes = State.usePanesAPI();
@sergeysova
sergeysova / README-Template.md
Created June 6, 2020 18:32 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@sergeysova
sergeysova / _nginx_docker_config.md
Created April 4, 2020 10:57 — forked from KostyaEsmukov/_nginx_docker_config.md
Nginx configuration sample for docker

Nginx production configuration sample

This config assumes that nginx is run from docker image _/nginx.

docker commands

docker network create nginx

mkdir -p /etc/myproject/nginx

cd /etc/myproject/nginx

@sergeysova
sergeysova / nginx-tls.conf
Created April 3, 2020 07:05 — forked from gavinhungry/nginx-tls.conf
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Name: nginx-tls.conf
# Auth: Gavin Lloyd <[email protected]>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are omitted here.
#
# Example: https://www.ssllabs.com/ssltest/analyze.html?d=gavinhungry.io
#
@sergeysova
sergeysova / 1_triggers.sql
Last active March 23, 2020 10:56 — forked from fritzy/1_triggers.sql
Get table change notifications from Postgres as JSON
CREATE OR REPLACE FUNCTION table_update_notify() RETURNS trigger AS $$
DECLARE
id UUID;
BEGIN
IF TG_OP = 'INSERT' OR TG_OP = 'UPDATE' THEN
id = NEW.id;
ELSE
id = OLD.id;
END IF;
PERFORM pg_notify('table_update', json_build_object('table', TG_TABLE_NAME, 'type', TG_OP, 'record', NEW, 'prev', OLD)::text);
@sergeysova
sergeysova / file.js
Last active March 6, 2024 16:25 — forked from popuguytheparrot/file.js
ws store effector
import { createEffect, createEvent, createStore, merge } from "effector"
import nanoid from "nanoid"
import { parseObject, request } from "jsonrpc-lite"
const wsURL = `ws://localhost:${process.env.WS_PORT}`
const awaitingMap = new Map()
let socket
const open = createEvent()
.button {
border: 1px solid #555;
text-align: center;
padding: 0 12px;
color: #ddd;
cursor: pointer;
}
.button:hover {
background: rgba(255, 255, 255, .25)
import React, { useLayoutEffect, useRef } from 'react'
import { useStore } from 'effector-react'
import * as effector from 'effector'
import { pathOr } from 'ramda'
const trackCreateStore = effector.createEvent('trackCreateStore')
const trackCreateEvent = effector.createEvent('trackCreateEvent')
const trackCreateEffect = effector.createEvent('trackCreateEffect')
const trackCreateStoreObject = effector.createEvent('trackCreateStoreObject')
import { fetchStatus } from "@lib/fetch";
import { userApi } from "@feature/users/api";
import { actions } from "./symbiotes";
import * as selectors from "./selectors";
/*
userApi.fetchUser() should throw an Error, if server returned object with error
*/
/*