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
@oskar-gmerek
oskar-gmerek / RGB-To-Hex.txt
Created August 29, 2023 21:57 — forked from CoGrammarCodeReview/RGB-To-Hex.txt
RGB to HEX conversion
NO GENERATIVE AI SUCH AS CHATGPT, BARD, BINGCHAT ETC. IS ALLOWED!
SOLUTIONS ARE MEANT TO BE YOUR OWN ATTEMPT AT THE PROBLEM AND PLAGIARISM USING CODE SNIPPETS FROM ONLINE IS NOT ALLOWED!
You will be required to also leave comments that clearly explain how your code works.
-------------------------------------------------------------------------------------------------------------------------
PROBLEM STATEMENT:
Create a function that takes the RGB values of a colour and converts it to the corresponding HEX value for that colour.
@oskar-gmerek
oskar-gmerek / Morse Code Challenge
Created August 29, 2023 21:57 — forked from CoGrammarCodeReview/Morse Code Challenge
Morse Code Challenge HyperionDev Coding Night
For this challenge, you will be required to build a Morse code encryptor and decrypter. You can use any langauge of your choosing
to complete the challenge.
Morse code is a method used in telecommunication to encode text characters as standardized sequences of two different signal durations,
called dots and dashes, or dits and dahs. Morse code is named after Samuel Morse, one of the inventors of the telegraph.
You can find a table of Morse code characters here:
https://morsedecoder.com/
Please note that for the purpose of this exercise, where there is a space between words, you should use "/" to separate words in your
@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
const pkgcloud = require('pkgcloud');
const streamifier = require('streamifier');
module.exports = {
init(providerOptions) {
const client = pkgcloud.storage.createClient(providerOptions);
const options = { container: providerOptions.defaultContainerName }
const remoteURL = () =>