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
import os | |
import requests | |
from bs4 import BeautifulSoup | |
from urllib.parse import urljoin | |
from datetime import datetime | |
# URL | |
url = "https://www.banxico.org.mx/servicios/boletin-mensual-de-la-biblioteca-del-banco-de-mexi/boletin-mensual-biblioteca-pu.html" | |
# Carpeta local donde se guardarán los archivos PDF |
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
# Running Rscript | |
$fecha = Get-Date -Format "yyyy-MM-dd" | |
Start-Process "Rscript.exe" -ArgumentList "C:\Users\vjvelascorios\Documents\weekly-cran-packages\code\CRAN Package Tables WindowsVersion.R" -NoNewWindow -Wait | |
# repo update | |
cd "C:\\Users\\vjvelascorios\\Documents\\weekly-cran-packages" | |
git add . | |
git commit -m "Weekly update - $fecha" #not tested with "fecha" legend | |
git push |
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
#!/bin/bash | |
script_path=$(realpath "${BASH_SOURCE[0]}") | |
cd "$(dirname "$script_path")" | |
shopt -s extglob | |
find . -maxdepth 1 -type f ! -name "*.pdf" ! -name "*.md" ! -name "*.tex" ! -name "$(basename "$script_path" | tr -d '[:space:]')" -exec rm {} + |
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
# Paso 1: Matriz simétrica y definida positiva | |
A = [4.0 2.0 -1.0; | |
2.0 5.0 3.0; | |
-1.0 3.0 6.0] | |
# Paso 2: Vector de términos constantes | |
b = [1.0, 2.0, 3.0] | |
# Paso 3: descomposición de Cholesky | |
L = cholesky(A).L |
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
mkdir="~/localsites" | |
base_dir="/home/vjvelascorios/localsites" | |
for url in "$@" | |
do | |
sitio=$(echo "$url" | awk -F[/:] '{print $4}') | |
mkdir -p "$base_dir/$sitio" | |
httrack "$url" -O "$base_dir/$sitio" | |
done |
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
# Get date (YYYY-MM-DD) | |
$fecha = Get-Date -Format "yyyy-MM-dd" | |
# URL | |
$url = "https://www.elfinanciero.com.mx/graficos/edicion-impresa/download.php?file=edicion-digital.pdf" | |
# Download folder | |
$carpeta_descargas = "C:\Users\vjvelascorios\Desktop\El Financiero" | |
# Filename |
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
##!/bin/bash | |
# | |
#notes: | |
# - yes, maybe mv /a/b/*.extensionfile /a/b it's simple | |
# - just move this file to /usr/local/bin/ | |
# - from 6 to 13 is a first experiment with this tool | |
# - to move files safely to bin is necessary install trash-cli | |
# - rsync was replaced for simple mv command for a better performance | |
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
alias renombrarvideos='find . -maxdepth 1 -type f \( -name "*.mp4" -o -name "*.mkv" -o -name "*.webm" \) -exec bash -c '\'' | |
for file; do | |
resolution=$(ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 "$file" 2>/dev/null) | |
ext="${file##*.}" | |
if [ -n "$resolution" ] && ! [[ "$file" =~ "_$resolution" ]]; then | |
newname="$(basename "$file" ".$ext")_$resolution.$ext" | |
mv "$file" "$newname" | |
fi | |
done | |
'\'' bash {} +' |
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
#!/bin/bash | |
# Verificar directorio | |
if ! ls *.pdf 1> /dev/null 2>&1; then | |
echo "Error: No se encontraron archivos en el directorio actual" | |
exit 1 | |
fi | |
# Nombre del directorio actual | |
folder_name=$(basename "$PWD") |
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
niveles <- function(x) { | |
resultado <- levels(as.factor(x)) | |
return(resultado) | |
} | |
if (interactive() && requireNamespace("rsthemes", quietly = TRUE)) { | |
# Set preferred themes if not handled elsewhere.. | |
rsthemes::set_theme_light("base16 Summerfruit Light {rsthemes}") # light theme | |
rsthemes::set_theme_dark("base16 Brewer {rsthemes}") # "base16 Brewer {rsthemes}" "base16 PhD {rsthemes}" |
NewerOlder