Skip to content

Instantly share code, notes, and snippets.

View Konard's full-sized avatar
🖥️
Watch how I code at https://www.youtube.com/c/КонстантинДьяченко

Konstantin Diachenko Konard

🖥️
Watch how I code at https://www.youtube.com/c/КонстантинДьяченко
View GitHub Profile
@Konard
Konard / deep-ai-system-message.md
Last active May 25, 2024 10:51
Deep AI system message

You are Deep AI that is speaking to users via Discord. When users mention <@1214599275976073376> they mention you (Deep AI Discord agent based on GPT-4o).

Deep is a system that uses PostgreSQL via Hasura. It operates with triplet and doublet links networks L ↦ L³/L ↦ L².

links table have columns: id, type_id (mandatory) , from_id , to_id (all with bigint type, 0 by default). numbers, strings, objects tables have columns id, link_id and value. value column has: text type in strings table, numeric type in numbers table and jsonb type in objects table.

We have DeepClient class in JavaScript, that usually placed in deep variable. It has select, insert, update, delete methods. These methods return object with data field, it is an array. objects array is first argument of insert method, we pass array or single object directly as the first argument here. where object is the first argument of select, update, delete methods, this object does n

@Konard
Konard / deep-package-code-extraction.md
Created December 20, 2023 03:40
A guide to code extraction from deep.json

vscode replace regexes

new-line symbols

regex

(\\r)?\\n

replacement

@Konard
Konard / simple-sync-handler.js
Last active October 29, 2023 19:03
Sync handlers examples for Deep (http://github.com/deep-foundation)
() => {
return "result";
}
async ({ data: { newLink, oldLink }, deep, require }) => {
if (!newLink?.value?.value) return;
const currentId = newLink?.id || oldLing?.id;
const Az = require('az');
const Word = Number(await deep.id('@deep-foundation/post-to-cloud', 'Word'));
const Count = Number(await deep.id('@deep-foundation/post-to-cloud', 'Count'));
const Post = Number(await deep.id('@deep-foundation/rss-to-deep', 'Post'));
const Then = Number(await deep.id('@deep-foundation/core', 'Then'));
const Resolved = Number(await deep.id('@deep-foundation/core', 'Resolved'));
const Rejected = Number(await deep.id('@deep-foundation/core', 'Rejected'));
async ({ data: { newLink, oldLink }, deep, require }) => {
if (!newLink?.value?.value) return;
const nlp = require('ru-compromise');
const Word = Number(await deep.id('@deep-foundation/post-to-cloud', 'Word'));
const Count = Number(await deep.id('@deep-foundation/post-to-cloud', 'Count'));
const Post = Number(await deep.id('@deep-foundation/rss-to-deep', 'Post'));
const textToWords = (text) => {
const hash = {};
const doc = nlp(text)
doc.match('#Pronoun').remove();

Header 1

Header 2

Word 1 word 2 word 3

async ({ deep, require }) => {
const React = require('react');
const { useDebounceCallback } = require('@react-hook/debounce');
const { useRef, useEffect, useState, useCallback } = React;
const { Input, SimpleGrid, Box, Button } = require('@chakra-ui/react');
const WordCloud = require('react-d3-cloud');
const { useLocalStore } = require('@deep-foundation/store/local');
const ResizeDetector = require('react-resize-detector');
const { useSpaceId, useRefAutofill } = require('@deep-foundation/deepcase');
const Min = await deep.id('@deep-foundation/rss-to-deep', 'Min');
async ({ deep, require }) => {
const React = require('react');
const { Box, Img, Text, useColorMode } = require('@chakra-ui/react');
const { useDebounceCallback } = require('@react-hook/debounce');
const { AnimatePresence, useAnimation, motion, useInView, useMotionValue, useSpring, useTransform, useIsPresent } = require('framer-motion');
const { useEffect, useRef, useState } = require('react');
const { ClientHandler } = require('@deep-foundation/deepcase');
const variantTitleSide = {
show: {
async ({ deep, require }) => {
const React = require('react');
const { Box, Img, Text, useColorMode } = require('@chakra-ui/react');
const { useDebounceCallback } = require('@react-hook/debounce');
const { AnimatePresence, useAnimation, motion, useInView, useMotionValue, useSpring, useTransform, useIsPresent } = require('framer-motion');
const { useEffect, useRef, useState } = require('react');
const { ClientHandler } = require('@deep-foundation/deepcase');
const transition = {
type: "spring", mass: 0.5, bounce: 0.25, stiffness: 200, damping: 100
};
async ({ deep, require }) => {
const React = require('react');
const { Box, Img, Text, useColorMode } = require('@chakra-ui/react');
const { useDebounceCallback } = require('@react-hook/debounce');
const { AnimatePresence, useAnimation, motion, useInView, useMotionValue, useSpring, useTransform, useIsPresent } = require('framer-motion');
const { useEffect, useRef, useState } = require('react');
const transition = {
type: "spring", mass: 0.5, bounce: 0.25, stiffness: 200, damping: 100
};