Steps to deploy Node.js to VPS using PM2 and Github Actions
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 python3 | |
# https://www.geeksforgeeks.org/python-different-ways-to-kill-a-thread/ | |
import sys | |
import threading | |
class ThreadTrace(threading.Thread): | |
def __init__(self, *args, **keywords): | |
threading.Thread.__init__(self, *args, **keywords) | |
self.killed = False |
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 python3 | |
import time | |
import threading | |
class Chronometer: | |
def __init__(self): | |
self.clear() | |
def init(self): |
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 python3 | |
import base64 | |
class CipherText: | |
"""Class for text ciphering.""" | |
KEY_SECRET = "123" | |
@staticmethod | |
def encrypt(original_text: str) -> str: |
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 python3 | |
import sqlite3 | |
import typing | |
def execute_db_query(db_filename: str, query: str, parameters: tuple=()) \ | |
-> typing.Any: | |
"""Execute a query in a SQLite-type database. | |
Args: | |
db_filename: string with the name of the SQLite file. |
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 python3 | |
"""Singleton decorator class.""" | |
class Singleton: | |
def __init__(self, cls): | |
self.__cls = cls | |
self.__obj = None | |
def __call__(self, *args, **kwargs): | |
if not self.__obj: |
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
"-------------------------- | |
" .vimrc by Edgard Decena | | |
"-------------------------- | |
set autowrite " Automáticamente guarda un archivo cuando se sale de un buffer. | |
set autoread " Automáticamente reload un archivo cuando ha sido modificado. | |
set number " Números de línea. | |
set cursorline " Línea del cursor. | |
set background=dark " Fondo oscuro. | |
set mouse=r " Mouse en xterm o GUI, apretando CTRL mientras se selecciona. | |
set t_Co=256 |