Skip to content

Instantly share code, notes, and snippets.

View andre-f-paggi's full-sized avatar

André Franciscato Paggi andre-f-paggi

View GitHub Profile
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
cinst googlechrome
cinst git
cinst nodejs
cinst ccleaner
cinst procexp
cinst putty
cinst teamviewer
cinst sublimetext3
cinst googledrive
cinst cmder
@andre-f-paggi
andre-f-paggi / disable-power-options-windows.bat
Created September 23, 2017 22:35
Configure power options to never turn off: monitor, disk, hibernate, turn off
@echo off
powercfg.exe -x -monitor-timeout-ac 0
powercfg.exe -x -monitor-timeout-dc 0
powercfg.exe -x -disk-timeout-ac 0
powercfg.exe -x -disk-timeout-dc 0
powercfg.exe -x -standby-timeout-ac 0
powercfg.exe -x -standby-timeout-dc 0
powercfg.exe -x -hibernate-timeout-ac 0
powercfg.exe -x -hibernate-timeout-dc 0
@andre-f-paggi
andre-f-paggi / remover_artefatos_de_build_visual_studio.bat
Created August 31, 2017 17:25
Remove as pastas "bin" e "obj" de todos subdiretórios a partir do diretório atual
for /d /r . %%d in (bin,obj) do @if exist "%%d" rd /s/q "%%d"
@andre-f-paggi
andre-f-paggi / mssql_subquery.sql
Created August 30, 2017 02:11
Exemplo SubQuery MSSQL
-- <Tabela Feia de exemplo>
SELECT
'Caixa de canetas BIC' AS txt_produto,
'23765' AS txt_cod_prod,
CAST(1 as bit) AS bit_ativo
INTO #Tabela_Feia -- Tabela Temporária
INSERT INTO #Tabela_Feia (txt_produto, txt_cod_prod, bit_ativo) VALUES ('Elásticos', '12345', 0);
INSERT INTO #Tabela_Feia (txt_produto, txt_cod_prod, bit_ativo) VALUES ('Caderno', '23456', 1);
INSERT INTO #Tabela_Feia (txt_produto, txt_cod_prod, bit_ativo) VALUES ('Borracha', '34567', 0);
## if ((gcm choco.exe -ErrorAction SilentlyContinue) -eq $null)
# {
# iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
# }
# Initial Config
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
#Packages
cinst cmder -y
@andre-f-paggi
andre-f-paggi / removeAntesDosNumeros.js
Created October 11, 2016 19:32
Regex test in JS removeAntesDosNumeros e remove possíveis espaços vazios em dobro
var regexRemoveAntesDosNumeros = new RegExp(/(\D*)(\d*)*(\,(\d|\ )*)/g);
this.value = this.value.replace(regexRemoveAntesDosNumeros, "$2$3$4").replace(/\s+/g,' '); // Remove possíveis espaços vazios em dobro
// test string = a, 595, 535, 563 abc, 523 abcacascas ,543123
// test site https://regex101.com/