This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function SplitYear01(fechainicio As Date, fechaFin As Date) As Variant | |
Dim fechaActualInicio As Date | |
Dim fechaActualFin As Date | |
Dim finAnoFiscal As Date | |
Dim umatriz As Collection | |
Dim tupla() As Variant | |
Dim i As Integer | |
Dim count As Integer | |
' Crear una colección para almacenar las tuplas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub AddNewAccounts() | |
' Desactivar la actualización de pantalla y el cálculo automático para mejorar el rendimiento | |
Application.ScreenUpdating = False | |
Application.Calculation = xlCalculationManual | |
Dim wsParam As Worksheet | |
Dim ws As Worksheet | |
Dim lastRow As Long | |
' Establecer la hoja "param" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub SplitExcelFile() | |
Dim ws As Worksheet | |
Dim lastRow As Long | |
Dim i As Long | |
Dim chunkSize As Long | |
Dim outputFolder As String | |
Dim outputFileName As String | |
Dim totalValues As Long | |
Dim chunkCounter As Long | |
Dim chunkValues As Long |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Function to show a folder selection dialog | |
function Get-FolderDialog($initialDirectory) { | |
$folderBrowser = New-Object System.Windows.Forms.FolderBrowserDialog | |
$folderBrowser.RootFolder = [System.Environment+SpecialFolder]::MyComputer | |
$folderBrowser.SelectedPath = $initialDirectory | |
$folderBrowser.ShowNewFolderButton = $false | |
$result = $folderBrowser.ShowDialog() | |
if ($result -eq [System.Windows.Forms.DialogResult]::OK) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Calculate-Amortization { | |
param ( | |
[int]$assetNumber, | |
[double]$acquisitionCost, | |
[int]$usefulLife, | |
[string]$usefulLifeUnits, | |
[string]$depreciationStartDate, | |
[string]$capitalizationDate | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# -*- coding: utf-8 -*- | |
# Script para scrappear productos de los Supermercados DIA | |
# Necesita tener instalado el parser lxml: sudo apt-get install python-lxml | |
from bs4 import BeautifulSoup | |
from requests import get | |
import locale | |
import re | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install ffmpeg for macOS | |
brew install ffmpeg | |
# invoke ffmpeg while stating that must copy the first stream of metadata | |
ffmpeg -i in.opus -map_metadata 0:s:a:0 out.mp3 | |
# check the out file and verify the metadata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Table from API with Bootstrap</title> | |
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> | |
</head> | |
<body class="bg-light"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Calculando el FTE por centro de coste con base al importe facturado | |
SELECT a.Nombre_Trabajador, | |
a.Ceco, | |
sum(round(a.Particionado / b.Total, 4)) AS 'FTE', | |
sum(round(a.Particionado / b.Total, 4) * b.Total - a.Particionado) AS 'Check' | |
FROM ( | |
(SELECT a.Nombre_Trabajador, | |
a.CECO, | |
sum(a.Base) AS 'Particionado' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 1. Crear: base de datos y seleccionarla */ | |
CREATE DATABASE IF NOT EXISTS videoclub; | |
USE videoclub; | |
SET character_set_server = utf8mb4; | |
SET collation_server = 'utf8mb4_general_ci'; | |
/* 2. Crear tabla: socio */ | |
CREATE TABLE socios ( | |
codigo VARCHAR(10) NOT NULL, | |
nombre VARCHAR(20) NOT NULL, | |
apellidos VARCHAR(30) NOT NULL, |
NewerOlder