Skip to content

Instantly share code, notes, and snippets.

View vatsalsaglani's full-sized avatar
🎯
Focusing

Vatsal Saglani vatsalsaglani

🎯
Focusing
View GitHub Profile
from urllib.request import urlopen
from bs4 import BeautifulSoup as BS
import pandas as pd
from urllib.parse import urlparse, urlsplit
from PIL import Image
from urllib.request import urlopen
from bs4 import BeautifulSoup as BS
import pandas as pd
from urllib.parse import urlparse, urlsplit
from PIL import Image
website_page = 'http://nameofyourwebsite.com'
page = urlopen(website_page)
soup = BS(page)
soup
{'id': 1, 'meaning': 'become less in amount or intensity', 'word': 'abate'},
{'id': 2,
'meaning': 'markedly different from an accepted form',
'word': 'aberrant'},
{'id': 3, 'meaning': 'temporary cessation or suspension', 'word': 'abeyance'},
{'id': 4,
'meaning': 'run away; usually includes taking something or somebody alone',
'word': 'abscond'},
{'id': 5,
'meaning': 'sparing in consumption of especially food or drinks',
{'id': 1, 'meaning': 'become less in amount or intensity', 'word': 'abate'},
{'id': 2,
'meaning': 'markedly different from an accepted form',
'word': 'aberrant'},
{'id': 3, 'meaning': 'temporary cessation or suspension', 'word': 'abeyance'},
{'id': 4,
'meaning': 'run away; usually includes taking something or somebody alone',
'word': 'abscond'},
{'id': 5,
'meaning': 'sparing in consumption of especially food or drinks',
@vatsalsaglani
vatsalsaglani / install.sh
Created January 10, 2019 14:01
Download this .sh file and install it using "bash install.sh" command to install all the FAST-AI packages/libraries on your personal system. Implement all the concepts related to ML for coders taught at fast.ai on your personal computers. For macOS users open the file and check the comments.
echo "For macOS open this script file and check the comments!!!"
# FAST-AI ML for CODERS on your laptop using virtualenv
# Note: Your system must have python3.6 installed.
# Run this file using `bash install.sh`
sudo apt-get update
sudo apt-get python3-dev
sudo apt-get install python3-pip
# For macOS comment out the above three lines and uncomment the below given line and then run the file
# brew install python3-pip
echo"on macOS if the above command doesn't work open the script"
import subprocess
import io
from flask_cors import CORS
from flask import Flask, request, render_template, jsonify
@app.route('/predict_api', methods=['GET', 'POST'])
def predict_classes():
if request.method == 'GET':
return render_template('home.html', value = "Image")
@vatsalsaglani
vatsalsaglani / Dockerfile
Created June 6, 2022 07:08
Dockerfile and requirements for Lambda OpenCV
# Define function directory
ARG FUNCTION_DIR="/function"
FROM python:3.7 as build-image
RUN apt-get update
RUN apt-get install -y
@vatsalsaglani
vatsalsaglani / app.py
Last active June 7, 2022 16:26
FastAPI WebSocket & JS WS with headers
from typing import List
from fastapi import FastAPI, Header, WebSocket, WebSocketDisconnect
import uvicorn
app = FastAPI()
class ConnectionManager:
def __init__(self):
self.active_connections: List[WebSocket] = []
async def connect(self, websocket: WebSocket):
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.