Skip to content

Instantly share code, notes, and snippets.

View tomfun's full-sized avatar

Greg tomfun

  • itrdev
  • ukraine
View GitHub Profile

Article Introduction: Navigating Database Technologies for Hierarchical and Social Network Data Management

Overview

In today's digital landscape, efficient data management is pivotal, especially when dealing with complex structures like trees and graphs. These structures, foundational in computer science, dictate how data is stored, accessed, and manipulated across various platforms, from social networks to organizational systems. This article provides a comprehensive exploration of tree and graph structures and their implementation in different database systems, assessing their effectiveness in contexts ranging from hierarchical data management in traditional databases to sophisticated relationship mapping in graph databases.

Tree and Graph: A Comparative Study of Data Structures

Tree Structure
@tomfun
tomfun / index.js
Last active October 3, 2023 13:02
Print the shape of input with used values
const printValues = (data) => {
const getType = (value) => {
if (Array.isArray(value)) return 'array';
if (null === value) return 'null';
return typeof value;
};
const initResult = () => ({ _type: new Set([]), _values: new Set() })
const updateValues = (result = initResult(), item) => {
const type = getType(item);

end-to-end encryption

In order to use end-to-end encryption, it is enough to use a browser extension - it uses open pgp - open source for encryption and keys and just inserts a button to gmail :)

https://youtu.be/aAXIqnjbc-M?t=106 Mymail-Crypt for Gmail at chrome store

quite radical, simple, but it can fall off :)

there is a more reliable way, but you have to manually encrypt it - another extension

Pessimistic Locking in Node.js with TypeORM

In this article, we will explore pessimistic locking, its main aspects, and how to implement it in Node.js using TypeORM. Pessimistic locking is a strategy to prevent concurrent access to a resource by obtaining exclusive access to the resource before making any changes. This approach ensures that other transactions cannot modify the locked resource until the lock is released.

We will use a practical example to demonstrate how to implement pessimistic locking in a Node.js application using the TypeORM library. Our example will focus on a payment processing scenario, where multiple processes might attempt to update the status of a payment concurrently.

https://raspberrypi.stackexchange.com/questions/8265/btrfs-root-filesystem-on-raspbian

sudo apt install btrfs-progs initramfs-tools

'btrfs' | sudo tee -a /etc/initramfs-tools/modules

sudo mkdir -p /etc/initramfs-tools/hooks ; sudo mkdir -p /etc/initramfs-tools/scripts/local-premount ; sudo cp /usr/share/initramfs-tools/hooks/btrfs /etc/initramfs-tools/hooks ; sudo cp /usr/share/initramfs-tools/scripts/local-premount/btrfs /etc/initramfs-tools/scripts/local-premount; sudo chmod +x /etc/initramfs-tools/hooks/btrfs /etc/initramfs-tools/scripts/local-premount/btrfs

https://forums.raspberrypi.com/viewtopic.php?t=10532&sid=506b6601ef85b73e2e6cafc95f4636c6&start=50

Good ppa`s

  • add-apt-repository ppa:nextcloud-devs/client
  • add-apt-repository ppa:phoerious/keepassxc
  • add-apt-repository ppa:git-core/ppa
  • add-apt-repository ppa:andol/curl-http2

Linux mint base ubuntu table

Mint Ubuntu Proof
@tomfun
tomfun / README.md
Created July 25, 2022 13:18
Пример работы с пайтон проектом
@tomfun
tomfun / classFunc.ts
Created February 25, 2020 11:41
Example of async generators with typescript
import { generateSequence } form './simple'
class NumberTransfrormer {
transform = async function*(gen: AsyncGenerator<number>) {
for await (const n of gen) {
yield n * 2;
}
}
}
@tomfun
tomfun / static-web-site-hosting.example.com--cloudformer.template.json
Created October 24, 2019 10:59
Cloudformation template for AWS S3 Bucket, CloudFront, private access for static hosting of angular frontend project (with client side routing). Every 403 request replies with index.html. For some reason it takes a lot of time after end to start work well
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters" : {
"MainDomainName": {
"Description": "public pretty FQDN for cloudfront",
"Type": "String",
"Default": "example.com"
},
"AcmCertificateArn": {
"Description": "AWS certificate ID for cloudfront",