- brew (I/II)
- nvm
- pyenv (I)
- sdkman
brew install git \
function getValueByKeyJson(obj, key) { | |
if (obj === null || typeof obj !== 'object') { | |
return undefined; | |
} | |
if (obj.hasOwnProperty(key)) { | |
return obj[key]; | |
} | |
for (const property in obj) { |
const { request } = require('undici') | |
async makeCallback (callbackUrl, method, headers, body, message) { | |
try { | |
const res = await request(callbackUrl, { | |
method, | |
headers, | |
body | |
}) | |
if (res.statusCode >= 200 && res.statusCode < 300) { |
// k6 run sample-k6-getpost.js | |
import http from 'k6/http'; | |
import {sleep} from 'k6'; | |
export let options = { | |
insecureSkipTLSVerify: true, | |
noConnectionReuse: false, | |
stages: [ | |
{ duration: '1m', target: 10 }, |
import http from 'k6/http'; | |
import {sleep} from 'k6'; | |
export let options = { | |
insecureSkipTLSVerify: true, | |
noConnectionReuse: false, | |
stages: [ | |
{ duration: '1m', target: 10 }, | |
{ duration: '2m', target: 20 }, | |
{ duration: '1m', target: 0 }, |
const dig = (n1, n2, n3, n4) => { | |
const nums = n1.split("").concat(n2.split(""), n3.split("")); | |
if (n4 !== undefined){ | |
nums[9] = n4; | |
} | |
let x = 0; | |
for (let i = (n4 !== undefined ? 11:10), j = 0; i >= 2; i--, j++) { | |
x += parseInt(nums[j]) * i; | |
} |
Abaixo pontos de análise:
.explain("executionStats")
para verificar o status de execução da query. COLLSCAN
significa que todos os registro da collection foram escaneados.
queryPlanner.winningPlan.stage
: tipo de collection scanexecutionStats.nReturned
: número de documentos retornadosexecutionStats.totalKeysExamined
: valor 0
significa que o índice não foi usado.executionStats.totalDocumentsExamined
: total de documentos que a query examinou.executionStats.executionTimeMillis
: tempo de execução da query.const daysMonth = 30; | |
const months = 12 | |
const diffDates = (first, second) => { | |
const difference = first.getTime() - second.getTime(); | |
return Math.ceil(difference / (1000 * 3600 * 24)); | |
} | |
function calculate(end, date) { | |
const totalDays = diffDates(end, date); |
[user] | |
name = username | |
email = email | |
[github] | |
user = username_github | |
[includeIf "gitdir:~/some/dir/"] | |
path = .gitconfig_work | |
[init] | |
defaultBranch = main | |
[pull] |