Skip to content

Instantly share code, notes, and snippets.

View oskar-gmerek's full-sized avatar
👊
Welcome to my GitHub profile!

Oskar Gmerek oskar-gmerek

👊
Welcome to my GitHub profile!
View GitHub Profile
@nichtich
nichtich / README.md
Last active July 19, 2024 11:21 — forked from oodavid/README.md
How to automatically deploy from GitHub

Deploy your site with git

This gist assumes:

  • you have an online remote repository (github / bitbucket etc.)
  • you have a local git repo
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by Apache
  • the Apache user is named www-data (may be apache on other systems)
@bmaupin
bmaupin / free-backend-hosting.md
Last active November 16, 2024 15:03
Free backend hosting
@bmaupin
bmaupin / free-database-hosting.md
Last active November 19, 2024 09:05
Free database hosting
@ignat
ignat / node_distance.md
Last active August 11, 2023 15:10
Calculating distance between two nodes in SurrealDB

Calculating distance between two nodes in SurrealDB

Current version of SurrealDB doesn't have yet graph::shortest_path(node1, node2) function. It sure will be added later to a stable release. However if the task is simplified a little bit we can calculate the distance with the available functions already.

Assume we have a graph of users that resembles a social network where users can connect (make friends). And we want to label the connection distance between two users similar to LinkedIn:

  • direct connections are labeled as 1st
  • connections with the shortest path of 2 are labeled as 2nd
  • connections with the shortest path of 3 are labeled as 3rd
  • connections with the shortest path of 4 and more are labeled as nth
@oskar-gmerek
oskar-gmerek / node_distance.md
Created July 25, 2023 11:07 — forked from ignat/node_distance.md
Calculating distance between two nodes in SurrealDB

Calculating distance between two nodes in SurrealDB

Current version of SurrealDB doesn't have yet graph::shortest_path(node1, node2) function. It sure will be added later to a stable release. However if the task is simplified a little bit we can calculate the distance with the available functions already.

Assume we have a graph of users that resembles a social network where users can connect (make friends). And we want to label the connection distance between two users similar to LinkedIn:

  • direct connections are labeled as 1st
  • connections with the shortest path of 2 are labeled as 2nd
  • connections with the shortest path of 3 are labeled as 3rd
  • connections with the shortest path of 4 and more are labeled as nth