Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
//function to find first duplicate in array | |
function firstDuplicate(nums) { | |
let MyObj = {} | |
let myArr = [] | |
for (i=0; i< nums.length ; i++){ | |
for (j=i+1; j< nums.length; j++){ | |
if(nums[i] === nums[j]){ | |
MyObj[nums[i]] = j; | |
} |
//function sumPrimes sums all prime numbers up to the provided number | |
const isPrime = function (number) { | |
if (number <= 2) { | |
return 1; | |
} | |
for (let i = 2; i < number; i++) { | |
if (number % i === 0) { | |
return 0; | |
} |
//function checkIfEven checks if given number consists of only even digits | |
const checkIfEvenDigit = function (number) { | |
if (number % 2 === 0) { | |
return true; | |
} else { | |
return false; | |
} | |
}; |
// function makeArrayConsecutive returns the number of missing items between smallest | |
// and largest number in provided array | |
const makeArrayConsecutive = function (array) { | |
array.sort((a, b) => a - b); | |
let myArray = []; | |
for (i = array[0]; i < array[array.length - 1]; i++) { | |
myArray.push(i); | |
} | |
myArray = myArray.filter(function (el) { |
#include <stdio.h> | |
#include <time.h> | |
long int fibIt(int n) | |
//Funkcja oblicza i zwraca okreslony wyraz ciagu Fibonacciego metoda iteracyjna | |
{ | |
long int i, t1 = 0, t2 = 1, nastepnyWyraz; | |
for (i = 1; i <= n; ++i) | |
{ |
You need the terminal color codes. For linux it's the following (your system might be different, look it up): | |
//the following are UBUNTU/LINUX, and MacOS ONLY terminal color codes. | |
#define RESET "\033[0m" | |
#define BLACK "\033[30m" /* Black */ | |
#define RED "\033[31m" /* Red */ | |
#define GREEN "\033[32m" /* Green */ | |
#define YELLOW "\033[33m" /* Yellow */ | |
#define BLUE "\033[34m" /* Blue */ | |
#define MAGENTA "\033[35m" /* Magenta */ |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | |
# PS : ChatGPT makes mistakes, consider "trust but verify" principle | |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | |
#Events to Monitor | |
https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/plan/appendix-l--events-to-monitor | |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | |
#run | |
eventvwr.msc Event viewer | |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | |
Event Viewer(Local)-Windows Logs (shutdown / restart ) |