Skip to content

Instantly share code, notes, and snippets.

View Tomamais's full-sized avatar

Tomás Tomamais

View GitHub Profile
@Tomamais
Tomamais / modSelenium.bas
Created March 24, 2020 23:15
Live VBA na Veia
Dim driver As WebDriver
Sub ColetaDadosCorreios()
Set driver = New ChromeDriver
With driver
.Get "http://www2.correios.com.br/sistemas/precosPrazos/"
.FindElementById("data").SendKeys Format(DateAdd("d", 1, Now), "dd/MM/yyyy")
.FindElementByName("cepOrigem").SendKeys "01310-200" 'MASP - São Paulo
.FindElementByName("cepDestino").SendKeys "20021-200" 'Museu Nacional do Rio de Janeiro
.FindElementByName("servico").AsSelect().SelectByText ("PAC")
@Tomamais
Tomamais / modClassificarPlanilhas.bas
Created September 22, 2019 21:28
Classificar Planilhas Alfabeticamente
'source: https://qr.ae/TWs7hb
'author: Chip Pearson
Sub SortWorksheets()
Dim i As Long, j As Long, n As Long
Dim ws As Worksheet
Application.ScreenUpdating = False
With ActiveWorkbook
n = .Worksheets.Count
If n > 1 Then
For i = 2 To n
@Tomamais
Tomamais / Restart-Wi-Fi.ps1
Last active October 8, 2018 00:32
Powershell script to restart wi-fi connection
#Requires -RunAsAdministrator
if((Get-NetAdapter -Name 'Wi-Fi').Status -ne 'Connected' -And (Get-NetAdapter -Name 'Wi-Fi').Status -ne 'Up')
{
Write-Output "Restarting Wi-Fi..."
Disable-NetAdapter -Name 'Wi-Fi' -Confirm:$false -AsJob | Wait-Job
Enable-NetAdapter -Name 'Wi-Fi'-Confirm:$false
}
else
{
Write-Output "Wi-Fi is Ok!"
name: Teste Script Lab - Coletando CEPs
description: ''
author: Tomamais
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(run);
async function getAddressByCEP(CEP: string) {