Skip to content

Instantly share code, notes, and snippets.

View fernandovaller's full-sized avatar
🏠
Working from home

Fernando Valler fernandovaller

🏠
Working from home
View GitHub Profile
@fernandovaller
fernandovaller / restore-new-folder
Created January 10, 2023 14:19
Restaurar opção de criar nova pasta no windows
1) Win + R, digite: regedit
2) Vá até a propriedade: Computador\HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers
3) Botão direito sobre a pasta e clique em Novo > Chave 4) Nome da nova chave: new
5) Altere o valor da nova chave para: {D969A300-E7FF-11d0-A93B-00A0C90F2719}
6) Reiniciar o pc
@fernandovaller
fernandovaller / removeNinthDigit.js
Created July 11, 2022 14:44
JS: Remover nono dígito de um número de telefone
function removeNinthDigit(number) {
if (number.length == 11) {
let _ddd = number.substr(0, 2);
let _number = number.substr(-8, 9);
return `${_ddd}${_number}`;
}
return number;
}
@fernandovaller
fernandovaller / automatic-version-numbers-how-git.md
Last active May 18, 2022 13:44
Solution can be to use the Git tags to automatically generate the version number

Put this in a file called pre-push in .git/hooks/

#!/bin/sh
VERSION=$(git rev-list HEAD --count)
echo "Version number is: $VERSION"
sed -i -e "/.*RELEASE_VERSION*./ s/.*/define('RELEASE_VERSION', '${VERSION}');/" config/geral.php
# Optional step
# git add config/geral.php &&
# git commit -m "update release version for ${VERSION}"
@fernandovaller
fernandovaller / index.html
Created February 12, 2022 12:36
WhatsApp in Pure CSS and JS
<div class="page">
<div class="marvel-device nexus5">
<div class="top-bar"></div>
<div class="sleep"></div>
<div class="volume"></div>
<div class="camera"></div>
<div class="screen">
<div class="screen-container">
<div class="status-bar">
<div class="time"></div>
@fernandovaller
fernandovaller / config
Last active February 9, 2022 01:01
My config Visual Studio Code - VS Code
# Config file
Editor > Bracket Pair Colorization: Enabled
Editor › Guides: Bracket Pairs: true
Editor › Guides: Bracket Pairs Horizontal: true
# Extensão
Auto Rename Tag
vscode-icons
fluent icons
codesnap
@fernandovaller
fernandovaller / config-ssl-localhost
Created January 14, 2022 17:30
Config SSL Certificate WSL2 for localhost
# Download version correct
https://slproweb.com/products/Win32OpenSSL.html
# Windows
https://slproweb.com/download/Win64OpenSSL-1_1_1m.exe
Install > next > next
# Open CMD (ADMIN) in local install
C:\Program Files\OpenSSL-Win64\bin>
@fernandovaller
fernandovaller / script-export-classes.js
Created December 21, 2021 19:06
Script para exportar turmas do LMS
var data = [];
let inputSelect = document.querySelector("#tabObjects > form > div:nth-child(1) > div:nth-child(2) > select");
let trilha = inputSelect[inputSelect.selectedIndex].innerText;
let trilhaID = inputSelect[inputSelect.selectedIndex].value;
let turmas = [];
$('#classList tbody tr.resultSet.classSet').each(function(i, e){
@fernandovaller
fernandovaller / shell-script-example-for.sh
Created December 18, 2021 13:46
Exemplo de shell script em FOR com indice e valor
#!/bin/sh
declare -A DATA_BASES
DATA_BASES+=(
[table]="this table"
)
for TABLE in "${!DATA_BASES[@]}"; do
:
# table
@fernandovaller
fernandovaller / script-export-files.js
Created December 18, 2021 13:38
Script para exportar arquivos do LMS
let data = [];
let dados = $('table.singleTable1 > tbody > tr');
dados.each(function(index, el) {
let nome = $(el).find('td:nth-child(3)')[0];
let categoria = $(el).find('td:nth-child(6) span')[0];
let link = $(el).find('td:nth-child(10) a.icon-edit')[0];
@fernandovaller
fernandovaller / script-export-phases-files.js
Last active December 27, 2021 12:58
Script para exportar etapas e arquivos das trilhas do LMS
let nome_curso = ($('h1.cor1_color span').text()).replaceAll(':', '');
nome_curso = $.trim(nome_curso);
let trilha = document.querySelector("#select2-chosen-5").innerText;
nome_curso = `${nome_curso}-${trilha}`;
var etapa_itens = [];
var data = [];
$('li.stepContainer').each(function(i, e){
etapa_itens = [];