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
# unpacking | |
point1 = [0, 0] | |
point2 = [2, 4] | |
x1, y1 = point1 # x1 = 0, y1 = 0 | |
x2, y2 = point2 # x2 = 2, y2 = 4 | |
slope = (y2 - y1) / (x2 - x1) | |
print(slope) # Output: 2.0 |
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
docker build -t video-processing-service . | |
// for mac | |
docker build -t video-processing-service --platform linux/amd64 . | |
// List | |
docker images | |
// Run | |
docker run -p 3000:3000 -d video-processing-service |
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
# Stage 1: Build stage | |
FROM node:18 AS builder | |
# Set the working directory in the container to /app | |
WORKDIR /app | |
# Copy package.json and package-lock.json into the working directory | |
COPY package*.json ./ | |
# Install any needed packages specified in package.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
# Use an official Node runtime as a parent image | |
FROM node:18 | |
# Set the working directory in the container to /app | |
WORKDIR /app | |
# Install ffmpeg in the container | |
RUN apt-get update && apt-get install -y ffmpeg | |
# Copy package.json and package-lock.json into the working 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
// prerequisite: https://gist.github.com/neybapps/1e506cbc0eb536812c63184abe3b96e4 | |
// prerequisite: sudo apt-get update && sudo apt-get install -y ffmpeg | |
npm install fluent-ffmpeg | |
npm install --save-dev @types/fluent-ffmpeg | |
// under index.ts add: | |
import express from 'express'; | |
import ffmpeg from 'fluent-ffmpeg'; |
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
// This example will be about creating a express.js started folder for a service | |
// Check terminologies and other notes at the bottom/end | |
mkdir my-processing-service | |
cd my-processing-service | |
npm init -y | |
npm install express | |
npm install --save-dev typescript ts-node | |
npm install --save-dev @types/node @types/express | |
// Create a tsconfig.json file for TypeScript configuration: |
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 tkinter import * | |
from tkinter import Scrollbar | |
from bs4 import BeautifulSoup | |
import requests | |
import webbrowser | |
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'} | |
# import manan as m | |
flipkart='' | |
ebay='' |
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 python | |
ARG AIRFLOW_USER_HOME=/usr/local/airflow | |
ARG CLOUD_SDK_VERSION=295.0.0 | |
ENV AIRFLOW_HOME=${AIRFLOW_USER_HOME} | |
ENV CLOUD_SDK_VERSION=$CLOUD_SDK_VERSION | |
# Airflow | |
ARG AIRFLOW_VERSION=1.10.10 | |
ARG SQLAlchemy_VERSION=1.10.10 |
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 airflow.operators.email_operator import EmailOperator | |
def report_failure(context): | |
subject = 'Airflow critical: {{ti}}' | |
html_content = ( | |
'Try {{try_number}} out of {{max_tries + 1}}<br>' | |
'Exception:<br>{{exception_html}}<br>' | |
'Log: <a href="{{ti.log_url}}">Link</a><br>' | |
'Host: {{ti.hostname}}<br>' |