/**
* Generates a random UUID
* @param a - The parameter a is a number that is used to generate the UUID. If you don't pass a
* parameter, the function will generate a random number.
*/
const generateRandomUUID = (a) => (a ? (a ^ ((Math.random() * 16) >> (a / 4))).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, generateRandomUUID));
/**
* Return a new array with the elements of the original array in a random order.
* @param arr - The array to shuffle.
*/
const shuffleArray = (arr) => arr.sort(() => Math.random() - 0.5);
/**
* It takes an array, converts it to a Set, and then converts it back to an array
* @param arr - The array to be filtered.
*/
const getUnique = (arr) => [...new Set(arr)];
/**
* If the current element is an array, flatten it, otherwise, add it to the accumulator.
*/
const flatten = arr => arr.reduce((a, b) => a.concat(Array.isArray(b) ? flatten(b) : b), []);
/**
* Generate a random hex colour code.
*/
const generateRandomHexColor = () => `#${Math.floor(Math.random() * 0xffffff).toString(16)}`;
/**
* It takes three numbers, one for red, one for green, and one for blue, and returns a hexadecimal
* string representing the color
* @param r - red value
* @param g - The green value of the color.
* @param b - blue
*/
const rgbToHex = (r, g, b) => "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
/**
* It converts a hexadecimal color code to an RGB color code.
* @param hex - The hexadecimal color code.
*/
const hexToRgb = (hex) => hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (m, r, g, b) => '#' + r + r + g + g + b + b).substring(1).match(/.{2}/g).map(x => parseInt(x, 16));
/**
* Given an array of numbers, return the average of those numbers.
*/
const average = arr => arr.reduce((p, c) => p + c, 0) / arr.length;
/**
* It converts a string to camel case.
*/
const toCamelCase = str => str.replace(/(?:^\w|[A-Z]|\b\w)/g, (word, index) => index == 0 ? word.toLowerCase() : word.toUpperCase()).replace(/\s+/g, '');
/**
* Replace all words in a string with the first letter capitalized and the rest of the letters
* lowercase.
*/
const toTitleCase = str => str.replace(/\w\S*/g, txt => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());
/**
* Replace all whitespace characters with underscores and convert the string to lowercase.
*/
const toSnakeCase = str => str.replace(/\s+/g, '_').toLowerCase();
/**
* Convert a degree value to a radian value.
*/
const degToRad = deg => deg * (Math.PI / 180);
/**
* Convert radians to degrees.
*/
const radToDeg = rad => rad * (180 / Math.PI);
var data = [{ city: "New York" }, { city: "Chicago" }, { city: "Los Angeles" }];
console.table(data);
// output
┌─────────┬───────────────┐
│ (index) │ city │
├─────────┼───────────────┤
│ 0 │ 'New York' │
│ 1 │ 'Chicago' │
│ 2 │ 'Los Angeles' │
└─────────┴───────────────┘
Se você achar o guia útil, sinta-se à vontade para bater palmas e me seguir. Junte-se ao meio através deste link para acessar todos os artigos premium meus e de todos os outros escritores incríveis aqui no meio.
“Ele vai me proteger quando eu estiver em perigo. Ele me esconderá em sua tenda.
No atual cenário de negócios em rápida evolução, o conceito de trabalho híbrido e remoto ganhou um impulso sem precedentes. À medida que as empresas continuam a se adaptar às mudanças nas necessidades e expectativas de seus funcionários, especialistas de várias áreas se reuniram para discutir os benefícios, os desafios e o futuro dessa forma transformadora de trabalhar.
Quando você faz uma solicitação para facebook.com, seu computador procura o nome de domínio para traduzir esse nome de domínio em um endereço IP para que seu computador possa fazer essa conexão.
(Aviso - isso é sátira, com a intenção de ser alegremente subversivo - definitivamente não é para crianças) Você viu sua mãe e seu pai se esconderem na cozinha e fumarem aqueles cigarros fedorentos. Eles dizem a você.
Em 2022, com o lançamento do GPT-3, a habilidade de escrita parece se tornar menos importante. Com a IA, pessoas com redação ruim também podem gerar funcionários de qualidade.
Olá, entusiastas cibernéticos! Bem-vindo de volta ao OSINT para a série de caça a ameaças. No primeiro artigo, apresentei uma visão geral do OSINT e sua importância na caça às ameaças.