This file contains hidden or 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
# credit by : Pymmdrza.github.io | |
import random | |
from datetime import date | |
OS_CHOICES = { | |
"Macintosh": ["68K", "PPC", "Intel Mac OS X"], | |
"Windows": [ | |
"Win3.11", | |
"WinNT3.51", | |
"WinNT4.0", |
This file contains hidden or 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
//@version=5 | |
strategy(shorttitle="MMDRZA Bollinger Meta 0.1.0", title="Mmdrza - Bollinger Bands Strategy with New Algorithm for any chart", overlay=true, commission_type=strategy.commission.percent, commission_value=0.1, slippage=0, default_qty_type=strategy.percent_of_equity, default_qty_value=100) | |
// Inputs | |
length = input.int(20, minval=1, title="Length") | |
maType = input.string("SMA", "Basis MA Type", options = ["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"]) | |
src = input(close, title="Source") | |
mult = input.float(2.0, minval=0.001, maxval=50, title="StdDev") | |
offset = input.int(0, "Offset", minval = -500, maxval = 500) |
This file contains hidden or 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
# -------------------------------------- | |
# Programmer : github.com/PyMmdrza | |
# pip install tqdm ftplib boto3 pysftp | |
# -------------------------------------- | |
import ftplib | |
import pysftp | |
import boto3 | |
import tarfile | |
import zipfile | |
import os |
This file contains hidden or 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 mysql.connector | |
# Source database connection configuration | |
SOURCE_DB_CONFIG = { | |
'host': 'source_db_host', | |
'user': 'source_db_user', | |
'password': 'source_db_password', | |
'database': 'source_db_name' | |
} |
This file contains hidden or 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 | |
def create_project_structure_from_file(file_path, base_directory="PyMermid"): | |
""" | |
Create a file and folder structure based on the tree-like format in the input text file. | |
Args: | |
- file_path (str): The path to the text file containing the directory structure. | |
- base_directory (str): The base directory where the project structure will be created. | |
""" |
This file contains hidden or 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 requests | |
import concurrent.futures | |
from urllib.parse import urlparse | |
import boto3 | |
from botocore.exceptions import ClientError | |
from colorama import Fore, Style | |
from datetime import datetime | |
class S3Scanner: | |
def __init__(self): |
This file contains hidden or 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 bs4 import BeautifulSoup | |
import sys | |
import os | |
def generate_id_from_text(text): | |
""" | |
Generates a valid id from text by converting it to lower case, | |
removing special characters, and replacing spaces with hyphens. | |
""" | |
return text.lower().replace(" ", "-").replace(",", "").replace(".", "").replace("'", "").replace("\"", "").replace("&", "and") |
This file contains hidden or 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 struct | |
import hashlib | |
def read_block(file_path): | |
with open(file_path, 'rb') as f: | |
while True: | |
magic = f.read(4) | |
if len(magic) < 4: | |
break |
This file contains hidden or 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 naturalsize(num_bytes: int) -> str: | |
for unit in ['B', 'KB', 'MB', 'GB', 'TB']: | |
if num_bytes < 1024.0: | |
return f"{num_bytes:.2f} {unit}" | |
num_bytes /= 1024.0 | |
return f"{num_bytes:.2f} PB" |
NewerOlder