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
@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/
## 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 / 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);
@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 / 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
cinst googlechrome
cinst git
cinst nodejs
cinst ccleaner
cinst procexp
cinst putty
cinst teamviewer
cinst sublimetext3
cinst googledrive
cinst cmder
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Settings->Data Usage->Select Whatsapp-> And make sure Restrict background data is unchecked.
Or
Adictional options -> Power and Storage > Data Usage->Select Whatsapp-> And make sure Restrict background data is unchecked.
@andre-f-paggi
andre-f-paggi / my-vscode-extensions.txt
Last active September 28, 2017 21:12
How to get the list: ```cd /d %USERPROFILE%\.vscode\extensions``` and then ```dir /b```
abusaidm.html-snippets-0.1.0
alefragnani.project-manager-0.21.1
Angular.ng-template-0.1.7
christian-kohler.path-intellisense-1.4.2
CoenraadS.bracket-pair-colorizer-0.10.9
dbaeumer.vscode-eslint-1.3.2
donjayamanne.githistory-0.2.3
EditorConfig.editorconfig-0.10.1
eg2.tslint-1.0.9
HookyQR.beautify-1.1.1
tsc main.ts --target ES5 && node main.js