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 / input.txt
Created December 10, 2022 02:41
ChatGPT experiment to implement glob pattern inference
How should I implement pattern inference in Rust?
Input sequences may be: "aab" "aac" "aad"
Parts that are repeated in all sequences should be interpreted as a background (non-variable parts),
and a variable parts should be a foreground.
Each variable part should be represented as variable.
Example output for these sequences would be "aa*"
@Konard
Konard / input.txt
Last active December 10, 2022 02:34
ChatGPT experiment for implementation of pattern inference.
How to implement pattern inference in Rust?
There should be function named infer_pattern.
For input of a vector of strings “ab”, “ac” and “ad”, the output will be “a(b|c|d)”.
For the input of “ba”, “ca” and “da”, the output will be “(b|c|d)a”.
For input “acb” and “adb”, the output will be “a(c|d)b”.
@Konard
Konard / query-result.json
Created October 18, 2022 18:36
Links created on failed Gql Handler (error is missing).
{
"data": {
"links": [
{
"id": 1013,
"from_id": 162,
"to_id": 1010,
"type": {
"in": [
{
@Konard
Konard / litania.md
Last active November 5, 2022 14:52
Литания глубины

Остановись

Отпусти и отложи

Наблюдай и принимай

Помни:

  • Мозг автоматически рационализирует то, что ты делаешь. Начни делать что-то другое и скоро последуют объяснения почему нужно делать именно это.
@Konard
Konard / gitpod-unmigrate.log
Created October 15, 2022 17:25
Errors while executing gitpod-unmigrate.
gitpod /workspace/dev (main) $ npm run gitpod-unmigrate
> @deep-foundation/[email protected] gitpod-unmigrate /workspace/dev
> export NEXT_PUBLIC_ENGINES=0; export NEXT_PUBLIC_HIDEPATH=1; export npm_config_yes=true; export JWT_SECRET="{\"type\":\"HS256\",\"key\":\"3EK6FD+o0+c7tzBNVfjpMkNDi2yARAAKzQlk8O2IKoxQu4nF7EdAh8s3TwpHwrdWT6R\"}" export MIGRATIONS_ID_TYPE_SQL=bigint; export MIGRATIONS_ID_TYPE_GQL=bigint; export MIGRATIONS_HASURA_PATH=$(echo $(gp url 8080) | awk -F[/:] '{print $4}'); export DEEPLINKS_HASURA_PATH=$(echo $(gp url 8080) | awk -F[/:] '{print $4}'); export MIGRATIONS_HASURA_SSL=1; export DEEPLINKS_HASURA_SSL=1; export MIGRATIONS_HASURA_SECRET=myadminsecretkey; export DEEPLINKS_HASURA_SECRET=myadminsecretkey; export NEXT_PUBLIC_DEEPLINKS_SERVER=https://$(echo $(gp url 3007) | awk -F[/:] '{print $4}'); export NEXT_PUBLIC_GQL_PATH=$(echo $(gp url 3006) | awk -F[/:] '{print $4}')/gql; export NEXT_PUBLIC_GQL_SSL=1 DEEPLINKS_HASURA_PATH=$(echo $(gp url 8080) | awk -F[/:] '{print $4}'); export DEEPLINKS_H
@Konard
Konard / gitpod-migrate.log
Created October 15, 2022 17:22
Errors while executing gitpod-migrate.
gitpod /workspace/dev (main) $ npm run gitpod-migrate
> @deep-foundation/[email protected] gitpod-migrate /workspace/dev
> export NEXT_PUBLIC_ENGINES=0; export NEXT_PUBLIC_HIDEPATH=1; export npm_config_yes=true; export JWT_SECRET="{\"type\":\"HS256\",\"key\":\"3EK6FD+o0+c7tzBNVfjpMkNDi2yARAAKzQlk8O2IKoxQu4nF7EdAh8s3TwpHwrdWT6R\"}" export MIGRATIONS_ID_TYPE_SQL=bigint; export MIGRATIONS_ID_TYPE_GQL=bigint; export MIGRATIONS_HASURA_PATH=$(echo $(gp url 8080) | awk -F[/:] '{print $4}'); export DEEPLINKS_HASURA_PATH=$(echo $(gp url 8080) | awk -F[/:] '{print $4}'); export MIGRATIONS_HASURA_SSL=1; export DEEPLINKS_HASURA_SSL=1; export MIGRATIONS_HASURA_SECRET=myadminsecretkey; export DEEPLINKS_HASURA_SECRET=myadminsecretkey; export NEXT_PUBLIC_DEEPLINKS_SERVER=https://$(echo $(gp url 3007) | awk -F[/:] '{print $4}'); export NEXT_PUBLIC_GQL_PATH=$(echo $(gp url 3006) | awk -F[/:] '{print $4}')/gql; export NEXT_PUBLIC_GQL_SSL=1 DEEPLINKS_HASURA_PATH=$(echo $(gp url 8080) | awk -F[/:] '{print $4}'); export DEEPLINKS_HASUR
@Konard
Konard / gitpod-unmigrate.log
Created October 15, 2022 17:14
Deadlocks while using gitpod-unmigrate.
gitpod /workspace/dev (main) $ npm run gitpod-unmigrate
> @deep-foundation/[email protected] gitpod-unmigrate /workspace/dev
> export NEXT_PUBLIC_ENGINES=0; export NEXT_PUBLIC_HIDEPATH=1; export npm_config_yes=true; export JWT_SECRET="{\"type\":\"HS256\",\"key\":\"3EK6FD+o0+c7tzBNVfjpMkNDi2yARAAKzQlk8O2IKoxQu4nF7EdAh8s3TwpHwrdWT6R\"}" export MIGRATIONS_ID_TYPE_SQL=bigint; export MIGRATIONS_ID_TYPE_GQL=bigint; export MIGRATIONS_HASURA_PATH=$(echo $(gp url 8080) | awk -F[/:] '{print $4}'); export DEEPLINKS_HASURA_PATH=$(echo $(gp url 8080) | awk -F[/:] '{print $4}'); export MIGRATIONS_HASURA_SSL=1; export DEEPLINKS_HASURA_SSL=1; export MIGRATIONS_HASURA_SECRET=myadminsecretkey; export DEEPLINKS_HASURA_SECRET=myadminsecretkey; export NEXT_PUBLIC_DEEPLINKS_SERVER=https://$(echo $(gp url 3007) | awk -F[/:] '{print $4}'); export NEXT_PUBLIC_GQL_PATH=$(echo $(gp url 3006) | awk -F[/:] '{print $4}')/gql; export NEXT_PUBLIC_GQL_SSL=1 DEEPLINKS_HASURA_PATH=$(echo $(gp url 8080) | awk -F[/:] '{print $4}'); export DEEPLINKS_H
@Konard
Konard / gitpod-error.txt
Created October 3, 2022 16:35
Error occurs when I try to open deep-foundation dev repository in GitPod
Gitpod's logo
Oh, no! Something went wrong!
cannot initialize workspace: cannot initialize workspace: prebuild initializer: git fetch -p -P --tags -f failed (exit status 1): From https://github.com/deep-foundation/dev * [new branch] deeplinks-21-menzorg -> origin/deeplinks-21-menzorg * [new branch] depricated -> origin/depricated * [new branch] dev-77-menzorg -> origin/dev-77-menzorg * [new branch] docker-hub-menzorg-deepcase -> origin/docker-hub-menzorg-deepcase * [new branch] gitpod-fix-menzorg -> origin/gitpod-fix-menzorg * [new tag] 0.0.20 -> 0.0.20 warning: d34be8037aae83bb38767c4eb56911eb14af8695:.gitmodules, multiple configurations found for 'submodule.packages/hasura.path'. Skipping second one! warning: d34be8037aae83bb38767c4eb56911eb14af8695:.gitmodules, multiple configurations found for 'submodule.packages/hasura.url'. Skipping second one! warning: d34be8037aae83bb38767c4eb56911eb14af8695:.gitmodules, multiple configurations found for 'submodule.packages/hasura-example.path'. Skipping second one! w
@Konard
Konard / copilot.sh
Last active April 25, 2022 13:12
Script that gets input file as a context and outputs multiple generated code version using VSCode autocompletion via GitHub Copilot.
FILE="$1"
code -n "$FILE"
printf "" | xclip -i
sleep 35
WINDOW="$FILE - Visual Studio Code"
WINDOW_ID=$(xdotool search --name "$WINDOW")
@Konard
Konard / .migrate
Created March 26, 2022 12:17
A file that keeps track of applied migrations.
{
"lastRun": "1642827746040-demo.ts",
"migrations": [
{
"title": "1616701513782-links.ts",
"timestamp": 1648294215755
},
{
"title": "1621815803560-auto-indexes.ts",
"timestamp": 1648294216011