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 Dyachenko Konard

🖥️
Watch how I code at https://www.youtube.com/c/КонстантинДьяченко
View GitHub Profile

Вопрос

Как в gtk3 на го сменить задний фон у box

Ответ

GTK (GIMP Toolkit) - это кроссплатформенный инструментарий для создания графических интерфейсов пользователя. Хотя GTK написан на C, для него существуют связки с другими языками программирования, включая Go.

Чтобы изменить фоновый цвет виджета Box в GTK3 на Go, вам понадобиться использовать функцию ModifyBg или OverrideBackgroundColor, которые являются частью библиотеки GTK. Такие функции позволяют изменить цвета стилей виджетов.

@Konard
Konard / cartesian.py
Created April 3, 2024 21:56
Comparision of tensor product and cartesian product
import itertools
def cartesian_product_vectors(vector1, vector2):
product = list(itertools.product(vector1, vector2))
return product
def cartesian_product_scalar(scalar1, scalar2):
return cartesian_product_vectors([scalar1], [scalar2])
scalar_a = 2
@Konard
Konard / deep-ai-system-message.md
Last active March 6, 2024 22:46
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).

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 not contain where field, this object also does not include returning field. table and re

@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: {