WAITING
?
PLEASE
TURN
OFF
YOUR
ENGINE
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
| #!/bin/bash | |
| echo -e "Fixing dpkg Error Code" | |
| echo -e "Looking Into dpkg Info" | |
| sudo mv /var/lib/dpkg/info /var/lib/dpkg/info_silent | |
| echo -e "Creating Directory" | |
| sudo mkdir /var/lib/dpkg/info | |
| echo -e "Updating System" | |
| sudo apt-get update -y | |
| echo -e "Checking Dependencies & Installing" |
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
| RewriteEngine on | |
| RewriteCond %{HTTP_HOST} ^olddomain.me [NC,OR] | |
| RewriteCond %{HTTP_HOST} ^blog.olddomain.me [NC] | |
| RewriteRule ^(.*)$ https://newdomain.com/$1 [L,R=301,NC] |
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
| keys: | |
| consumer_key: CONSUMER_KEY | |
| consumer_secret: CONSUMER_SECRET | |
| access_token: ACCESS_TOKEN | |
| access_token_secret: ACCESS_TOKEN_SECRET | |
| bearer_token: BEARER_TOKEN |
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
| class TestRecentSearch(unittest.TestCase): | |
| class Search(RecentSearch): | |
| query = ['python'] | |
| max_results = ['10'] | |
| tweet_fields = ['created_at', 'lang', 'conversation_id'] | |
| def setUp(self) -> None: | |
| self.search = self.Search() | |
| for x in self.search.connect(): |
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
| Launching pytest with arguments test_stream.py::TestRecentSearch in /home/saadman/twitter-stream.py/tests | |
| ============================= test session starts ============================== | |
| platform linux -- Python 3.8.5, pytest-6.1.2, py-1.9.0, pluggy-0.13.1 -- /home/saadman/twitter-stream.py/env/bin/python | |
| cachedir: .pytest_cache | |
| rootdir: /home/saadman/twitter-stream.py | |
| collecting ... collected 1 item | |
| test_stream.py::TestRecentSearch::test_result_count |
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 json | |
| import requests | |
| from pprint import pprint | |
| def detect_document(path: str) -> str: | |
| """Makes manual Http request to the https://vision.googleapis.com/v1/files:annotate |
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 google.cloud import vision | |
| if __name__ == '__main__': | |
| client = vision.ImageAnnotatorClient() | |
| response = client.annotate_image({ | |
| 'image': {'source': {'image_uri': 'https://bit.ly/3mXXjy0'}}, | |
| 'features': [{'type_': vision.Feature.Type.DOCUMENT_TEXT_DETECTION}] | |
| }) | |
| for words in response.text_annotations[1:]: | |
| print(words.description) |
~$ mkdir object-recognition
~$ cd object-recognition
~$ virtualenv --python=python3.8 venv
~$ pip3 install google-cloud-vision==2.0.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
| import io | |
| import argparse | |
| from google.cloud.vision_v1 import ImageAnnotatorClient, Image | |
| from colorama import init, Fore | |
| def cli() -> None: | |
| init() | |
| parser = argparse.ArgumentParser() |
NewerOlder