Skip to content

Instantly share code, notes, and snippets.

View Theasker's full-sized avatar

Mauricio Segura Ariño Theasker

  • Zaragoza (Spain)
View GitHub Profile
@Theasker
Theasker / sendTelegram.py
Last active November 16, 2022 20:07
Telegram bot in Python for use in Terminal. You can send message, video, audio, image and document.
#!/usr/bin/python3
#-*- coding: utf-8 -*-
# config.ini structure
#
# {
# "token": "xxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
# "channel": "-1111111111111",
# "group": "-22222222222",
# "botname": "name_bot",
@Theasker
Theasker / dockersLandPage.py
Created November 7, 2022 14:21
Actualización de una "Land Page" de los servicios docker usados con Caddy Docker Proxy
#!./venv/bin/python3
import os
# Buscamos los ficheros que cumplen la condición
def find_files(dir, findFile, findText):
for root, dir, files in os.walk(dir):
for file in files:
if(findFile in file.lower()):
filePath=root+"/"+file
# print(filePath)
@Theasker
Theasker / excel.py
Last active October 4, 2022 09:37
Modificación de formato de las fechas en una columna de un archivo excel en python
import pandas as pd
# Read the file and specify which column is the date
rows = pd.read_excel("excel.xlsx")
print(rows["Columna1"])
# Output with dates converted to YYYY-MM-DD
fecha = pd.to_datetime(rows["Columna1"]).dt.strftime("%d-%m-%y")
rows["Columna1"] = fecha
@Theasker
Theasker / theasker.conf
Created May 21, 2021 17:33
conky configuration
conky.config ={
-- CONKY SETTINGS
background = false,
update_interval = 1,
total_run_times = 0,
cpu_avg_samples = 2,
net_avg_samples = 2,
override_utf8_locale = true,
@Theasker
Theasker / telegramBotScrap.py
Last active May 5, 2021 19:42
Telegram bot with scrap and scheduler in Python
# thanks to https://platzi.com/blog/bot-python/
from bs4 import BeautifulSoup #del módulo bs4, necesitamos BeautifulSoup
import requests
import schedule
import time
def bot_send_text(bot_message):
bot_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
@Theasker
Theasker / CRUD_products.py
Last active April 2, 2021 11:57
CRUD products with Python and SQLite
from tkinter import ttk
from tkinter import *
import os
import errno
import sqlite3
class Products:
db_name = r'.\db\database_products.db'
@Theasker
Theasker / rename.py
Last active March 29, 2021 11:54
Rename files from directory. Program done with Python and tkinter (working)
from tkinter import *
from tkinter import ttk
import os
class MyRenamer:
def __init__ (self, window):
window.title("Renombrador de archivos")
self.dir = ""
@Theasker
Theasker / app.component.html
Created June 18, 2018 07:34
Number Input Component with thousands separator.
<scen-input-numerico [(value)]="numero" required ></scen-input-numerico>
@Theasker
Theasker / app.component.ts
Created June 18, 2018 07:27
Angular number pipe with locale Internationalization (i18n)
import { Component, OnInit, LOCALE_ID } from '@angular/core';
//import { merge } from 'rxjs';
//import { MyCurrencyFormatterDirective } from "./directivas/my-currency-formatter.directive";
// Locales para number pipe
import { registerLocaleData } from '@angular/common';
import es from '@angular/common/locales/es';
registerLocaleData(es, 'es');
@Theasker
Theasker / launch.json
Created May 28, 2018 07:27
Configuratión file example for debug in Visual Studio Code
{
// Utilizar IntelliSense para aprender acerca de los posibles atributos.
// Mantenga el puntero para ver las descripciones de los existentes atributos
// Para más información, visite: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Chrome",
"type": "chrome",
"request": "launch",