Skip to content

Instantly share code, notes, and snippets.

View deyvicode's full-sized avatar

Deyvi De La Cruz deyvicode

View GitHub Profile
@deyvicode
deyvicode / convert-to-utf8.bat
Created February 21, 2025 21:07
Convierte todos los archivos .txt en .txt utf-8 dentro de una carpeta
@echo off
setlocal
:: Obtener la ruta actual
set "folderPath=%cd%"
:: Ejecutar el script de PowerShell 7
pwsh -NoProfile -ExecutionPolicy Bypass -Command ^
"Get-ChildItem -Path '%folderPath%' -Filter *.txt | ForEach-Object { $filePath = $_.FullName; $content = Get-Content -Path $filePath; Set-Content -Path $filePath -Value $content -Encoding utf8 }"
@deyvicode
deyvicode / unprotect.vba
Created February 20, 2025 22:54
Desproteger excel macros con proteccion de contraseña
Private Const PAGE_EXECUTE_READWRITE = &H40
Private Declare PtrSafe Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" _
(Destination As LongPtr, Source As LongPtr, ByVal Length As LongPtr)
Private Declare PtrSafe Function VirtualProtect Lib "kernel32" (lpAddress As LongPtr, _
ByVal dwSize As LongPtr, ByVal flNewProtect As LongPtr, lpflOldProtect As LongPtr) As LongPtr
Private Declare PtrSafe Function GetModuleHandleA Lib "kernel32" (ByVal lpModuleName As String) As LongPtr
Private Declare PtrSafe Function GetProcAddress Lib "kernel32" (ByVal hModule As LongPtr, _
ByVal lpProcName As String) As LongPtr
Private Declare PtrSafe Function DialogBoxParam Lib "user32" Alias "DialogBoxParamA" (ByVal hInstance As LongPtr, _
ByVal pTemplateName As LongPtr, ByVal hWndParent As LongPtr, _
@deyvicode
deyvicode / tto-anemia.md
Last active January 20, 2025 21:56
Guia HIS - Tratamiento Anemia

Guia para registro de tto anemia

tto de anemia en niños menores de 36 meses

Edad Nro Documento Edad Sexo Cond. EESS Cond. Serv.
6M 87654321 A M Peso Kg N N
M F Talla Cm C C
D Hb Valor R R
@deyvicode
deyvicode / filesinfolder.bas
Created September 7, 2022 22:01
VBA read files in folder
Sub LoopThroughFiles()
Debug.Print ""
Debug.Print "-------------------------------------------------"
Dim oFSO As Object
Dim oFolder As Object
Dim oFile As Object
Dim i As Integer
@deyvicode
deyvicode / no_transmisibles_21.bas
Last active September 8, 2022 16:31
CONSOLIDATORS
Sub consolidate()
Dim Destiny As Workbook
Set Destiny = ThisWorkbook
Dim Data As Workbook
Dim Path As String
Dim mrs As Variant
mrs = Array( _
@deyvicode
deyvicode / excel-spliter.bas
Last active February 27, 2022 13:17
Excel Splitter
Sub Test()
'declarar variables
Dim wb As Workbook
Dim ThisSheet As Worksheet
Dim NumOfColumns As Integer
Dim RangeToCopy As Range
Dim RangeOfHeader As Range
Dim WorkbookCounter As Integer
Dim RowsInFile
@deyvicode
deyvicode / searchbycolumn.bas
Last active February 27, 2022 13:18
Codigo para input busqueda por columna en Excel habilitado para macros
Private Sub BoxSearch_Change()
Dim text As String
If Sheet1.BoxSearch.value <> "" Then
text = "*" & Sheet1.BoxSearch.value & "*"
Range("A3").CurrentRegion.AutoFilter Field:=3, Criteria1:=text
Else
text = ""
Range("A3").CurrentRegion.AutoFilter
End If
End Sub
@deyvicode
deyvicode / getdate.js
Created January 8, 2022 13:15
Formatear fechas con traducciones en JavaScript.
const format = (date, locale, options) => new Intl.DateTimeFormat(locale, options).format(date)
const now = new Date()
format(now, 'es') // '8/1/2022'
format(now, 'es', { dateStyle: 'long' }) // '8 de enero de 2022'
format(now, 'es', { timeStyle: 'short' }) // '8:13'
format(now, 'ko') // '2022. 1. 8.'
format(now, 'en', { weekday: 'short', day: 'numeric' }) // '5 Wed'
@deyvicode
deyvicode / exporttojson.sql
Last active January 5, 2022 03:59
Export JSON file from SQL database
SELECT JSON_ARRAYAGG(JSON_OBJECT(
'name', name,
'address', address
))
FROM mybd.mytable
INTO OUTFILE '\path\users.json';
@deyvicode
deyvicode / ainfo.md
Last active December 27, 2021 14:23
My Custom Shell Themes

Personalización del la terminal en windows con:

  • PowerShell
  • Oh-my-posh
  • Fluent Terminal

deyvi-lean-prev.jpg