Skip to content

Instantly share code, notes, and snippets.

View 4lessandrodev's full-sized avatar
🎯
Focusing

Alessandro dev. 4lessandrodev

🎯
Focusing
View GitHub Profile
const { execSync } = require('child_process');
const { readFileSync } = require('fs');
const { resolve } = require('path');
function compareVersions(a, b) {
return a.replace(/\^|\~|\=/g, '') === b.version;
}
try {
const npmDeps = execSync('npm ls --json');
@4lessandrodev
4lessandrodev / order.ts
Last active April 27, 2022 12:34
Ordenar vetor de números com typescript
function ordenarVetorNumerico (vetorNumerico: number[]): number[] {
let indiceMenorValor = 0;
let auxiliar = 0;
const vetorCopia = [...vetorNumerico];
const tamanhoDoVetor = vetorNumerico.length;
const quantidadeDeNumeros = tamanhoDoVetor - 1;
for (let indiceA=0; indiceA<=quantidadeDeNumeros; indiceA++){
indiceMenorValor = indiceA;
// open your brave browser on brave home page
// press F12 or open your console on brave browser
// paste this script
// wait until it stops (45sec)
function goToEndOfPage(){
scrollToPub(9000000000)
}
// copy this script and paste on your console
var values = document.querySelectorAll('.flat-view-text-preserve');
var results = [];
values.forEach((value, i)=> { if(i % 2 === 0){ results.push({ [value.innerText]: values[i+1].innerText })} });
var textResult = '';
results.forEach((val) => textResult +=`${Object.keys(val)}=${Object.values(val)}\n`);
console.log(textResult);
@4lessandrodev
4lessandrodev / git-cheat-sheet.md
Last active February 7, 2022 18:35
Git commands - cheat-sheet

Git Cheat sheet

Git basics

Create a repository

$ git init <directory>
@4lessandrodev
4lessandrodev / deploy_to_ec2_from_bitbucket.txt
Last active January 23, 2022 20:02
deploy to ec2 from bitbucket using aws codepipeline and codedeploy
Create S3 bucket
> name: CodeDeployBucket
---------------------------------------------
Create IAM role for EC2
> name: EC2CodeDeployRole
> policy: AmazonEC2RoleforAWSCodeDeploy
> set key:
> Name: EC2CodeDeployRole
@4lessandrodev
4lessandrodev / bovespa_intraday.py
Created September 12, 2019 22:14 — forked from maurobaraldi/bovespa_intraday.py
Cotações da Bovespa Intraday
#!/usr/bin/env python
from datetime import datetime
from json import loads
from time import gmtime, mktime, strptime
# LevelDict é um wrapper usando dicionário para LevelDB
# https://github.com/maurobaraldi/leveldict
from leveldict import LevelJsonDict
from requests import get