This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const assert = require('assert').strict; | |
/** | |
* Pretty basic implementation to showcase non recursiveness. | |
* It would need to check for things such as Circular References in objects | |
*/ | |
function flatten(source) { | |
const result = {}; | |
// create an array that will hold depth-first keys as we encounter them during iteration | |
let keysArr = Object.keys(source); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Works on WSL2 installation with enabled SystemD (https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/) | |
# File location: /usr/lib/systemd/user/gnome-keyring-ssh.service | |
# You can try it out by issuing: | |
# 1. `systemctl --user daemon-reload` -- will load the newly added file | |
# 2. `systemctl --user start gnome-keyring-ssh.service` -- will start the keyring daemon so that you can verify that it works | |
# 3. `systemctl --user enable gnome-keyring-ssh.service` -- will enable the service to run on system startup | |
[Unit] | |
Description=Start gnome-keyring as SSH agent | |
[Service] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const readline = require('readline'); | |
// Tax percentages per salary level | |
const taxLevels = [10000, 20000, 30000, 40000, Infinity]; | |
const taxPercentages = [0.09, 0.22, 0.28, 0.36, 0.44]; | |
// Eisfora percentages | |
const eisforaLevels = [12000, 20000, 30000, 40000, 65000, 220000, Infinity]; |