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 | |
# -*- coding: utf-8 -*- | |
__license__ = "MIT" | |
__version__ = "0.1" | |
__py_version__ = "3.8.7" | |
__status__ = "Development" | |
import json | |
from pathlib import Path | |
from time import sleep |
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 | |
# -*- coding: utf-8 -*- | |
__license__ = "MIT" | |
__version__ = "0.0.1" | |
__maintainer__ = "https://github.com/liquidgenius" | |
__status__ = "Development" | |
from pathlib import Path | |
from pyngrok import ngrok |
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 low_pass_filter_anomaly_detection(df: pd.DataFrame, | |
column_name: str, | |
rolling_window: int, | |
number_of_stdevs_away_from_mean: float): | |
""" | |
Implement a low-pass filter to detect anomalies in a time series, and save the filter outputs | |
(True/False) to a new column in the dataframe. | |
Arguments: | |
df: Pandas dataframe | |
column_name: string. Name of the column that we want to detect anomalies in |
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 | |
# License: MIT; https://opensource.org/licenses/MIT | |
# Version: 0.0.1 | |
# Maintainer: https://gist.github.com/liquidgenius | |
# Gist: https://gist.github.com/liquidgenius/56167cfedc7270752d207377cf618fcf | |
#******************************************************************************* | |
# Masonite 3 Project Scaffolding |
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 | |
# License: MIT; https://opensource.org/licenses/MIT | |
# Version: 0.0.1 | |
# Maintainer: https://gist.github.com/liquidgenius | |
# Given a script main.py on an ubuntu machine in /home/ubuntu/app/src directory with the interpreter | |
# in /home/ubuntu/app/.venv directory in project. This script, run.sh, would be placed in the | |
# /home/ubuntu/app directory. |
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 | |
# License: MIT; https://opensource.org/licenses/MIT | |
# Version: 0.0.1 | |
# Maintainer: https://gist.github.com/liquidgenius | |
#******************************************************************************* | |
# Pycharmer; A Pycharm Python project creator | |
#******************************************************************************* |
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 | |
# -*- coding: utf-8 -*- | |
# https://orm.masoniteproject.com/ | |
# app.helpers.columns.py | |
from config.database import DB | |
from masoniteorm.collection import Collection | |
def columns(model): |
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
# Ensure we have the latest pip and pipenv | |
pip3 install --upgrade pip pipenv | |
# Setup new Python 3.8 project | |
pipenv --python 3.8 | |
# Install aws-lambda-powertools | |
pipenv install boto3 aws-lambda-powertools | |
# Install dev dependencies | |
pipenv install black pytest --dev --pre |
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 dataclasses import dataclass, fields as datafields | |
from ujson import dumps, loads | |
# Note: ujson seamlessly serializes dataclasses, unlike stdlib's json | |
@dataclass | |
class Point: | |
x: float | |
y: float | |
# Shallow dataclass can be rebuilt from dict/json: |
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 | |
# -*- coding: utf-8 -*- | |
from random import choice | |
import httpx | |
import fake_useragent | |
def Proxymesh(url, proxy_choices=None, headers=None, country='US'): |
NewerOlder