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 | |
# Please, make sure you have: python3, pytube and ffmpeg before running this script | |
DOWNLOAD_DIR="./downloads" | |
mkdir -p "${DOWNLOAD_DIR}" | |
pytube3 -a mp4 -t "${DOWNLOAD_DIR}" "${1}" | |
pushd "${DOWNLOAD_DIR}" | |
find . -type f -iname '*.mp4' -exec sh -c 'ffmpeg -i "$1" "${1%.*}.mp3"' sh {} \; |
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
from google.cloud.firestore_v1.field_path import FieldPath | |
def get_metrics(user_ids: list, db_client): | |
return db_client.collection(f'users').where(FieldPath.document_id(), 'in', user_ids).stream() |
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
def replace_wildcards(db_client, collection_path: str): | |
""" | |
Returns a generator with all the elements paths matching the collection expression. | |
Wildcards are allowed: So, you can use 'user/*/collection/*/subcollection/*' to retrieve all the | |
documents matching that expression. | |
""" | |
collection_parts = collection_path.split('*') | |
if len(collection_parts) == 1: | |
yield collection_parts[0] | |
else: |
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 () { | |
var $el = $('.fixedElement'), | |
originalTop = $el.offset().top; // store original top position | |
$(window).scroll(function(e){ | |
if ($(this).scrollTop() > originalTop ){ | |
$el.css({'position': 'fixed', 'top': '0px'}); | |
} else { | |
$el.css({'position': 'absolute', 'top': originalTop}); | |
} |
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
@echo off | |
echo ** Deteniendo el servicio de impresion. | |
:: Detiene el servicio de impresion | |
@net stop spooler > nul | |
echo ** Eliminando trabajos de la cola de impresion. | |
:: Elimina los archivos .shd y .spl | |
@del %systemroot%\system32\spool\printers\*.shd | |
@del %systemroot%\system32\spool\printers\*.spl | |
echo ** Iniciando el servicio de impresion. | |
:: Vuelve a iniciar el trabajo de impresion |
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 | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
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/env python | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
# GNU General Public License for more details. |
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
:: This program is free software: you can redistribute it and/or modify | |
:: it under the terms of the GNU General Public License as published by | |
:: the Free Software Foundation, either version 3 of the License, or | |
:: (at your option) any later version. | |
:: | |
:: This program is distributed in the hope that it will be useful, | |
:: but WITHOUT ANY WARRANTY; without even the implied warranty of | |
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
:: GNU General Public License for more details. | |
:: |
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
# | |
# Guia rapida | |
# | |
1. pygmail.py - Verifica los nuevos correos. | |
2. credentials.crd - Guarda sus credenciales encriptadas y es esencial para que pygmail.py funcione correctamente. | |
3. crypt_pygmail.py - Genera el archivo credentials.crd | |
4. Si usa crontab, es muy recomendable editar el valor de la variable "path_to_credentials_file" en el archivo pygmail.py para indicarle al programa exactamente donde encontrar el archivo credentials.crd | |
¿Problemas, sugerencias, etc? <luislopez72@gmail.com> |
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
# A is a list object | |
def equi ( A ): | |
# solution will store all solutions to the problem | |
solution = list() | |
# the sum of all list components | |
A_sum = 0 | |
# iterates for each element in the list | |
for index in range( len( A ) ): | |
A_sum += A[index] | |
# stores the sum of all components at left of this index position |
NewerOlder