Skip to content

Instantly share code, notes, and snippets.

View neybapps's full-sized avatar

NeybApps neybapps

View GitHub Profile
@neybapps
neybapps / Pythonic-Code.py
Created August 19, 2024 05:33
Pythonic Code
# 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
@neybapps
neybapps / .sh
Last active August 18, 2024 19:37
Building and running Docker images
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
# 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
@neybapps
neybapps / LOCAL Dockerfile with ffmpeg
Last active August 18, 2024 19:30
NODE Dockerfile
# 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
@neybapps
neybapps / FULLSTACK-VIDEO-PROCESSING-service.ts
Last active August 18, 2024 18:26
Video processing using Node.js/Express.js and ffmpeg with Typescript
// 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';
@neybapps
neybapps / FULLSTACK-SETUP-expressjs-service.ts
Last active August 18, 2024 18:20
Create a Node.js/Express.JS service with Typescript
// 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:
@neybapps
neybapps / E-Commerce price Comparison using python with gui.py
Created November 8, 2023 01:43 — forked from programingcorner/E-Commerce price Comparison using python with gui.py
Monitoring price comparison for a particular product on different e-commerce websites using Python. Particular we use beautiful Soup for scraping data from different website like amazon, flipkart ,ebay, olx etc. and with that we provide direct link to different website of our same search product . program description . we are using python tkint…
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=''
@neybapps
neybapps / Airflow.Dockerfile
Last active August 18, 2024 16:47
Minimalist Airflow Dockerfile
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
@neybapps
neybapps / failure_report.py
Created May 29, 2020 05:04
failure_function for airflow email reporting
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>'