Skip to content

Instantly share code, notes, and snippets.

@seatedro
seatedro / build.zig
Created September 18, 2024 18:47
static ffmpeg zig build
const std = @import("std");
const builtin = @import("builtin");
pub fn build(b: *std.Build) !void {
const av = b.option(bool, "av", "Compile ffmpeg") orelse false;
const optimize = b.standardOptimizeOption(.{ .preferred_optimize_mode = .ReleaseFast });
const dep_stb = b.dependency("stb", .{});
const dep_ffmpeg = b.dependency("ffmpeg", .{});
// Add a new step for compiling Ffmpeg
@ninely
ninely / main.py
Last active June 27, 2024 07:56
Langchain with fastapi stream example
"""This is an example of how to use async langchain with fastapi and return a streaming response.
The latest version of Langchain has improved its compatibility with asynchronous FastAPI,
making it easier to implement streaming functionality in your applications.
"""
import asyncio
import os
from typing import AsyncIterable, Awaitable
import uvicorn
from dotenv import load_dotenv
@nestukh
nestukh / installheadlessfirefoxonpi.sh
Last active May 19, 2024 03:56
Install firefox-esr + geckodriver + selenium + python3 on raspberry pi 3 and above
#!/bin/bash
pypcks="python3-pip python3 python3-all-dev python3-dev libffi-dev libssl-dev librtmp-dev python-dev python3 python3-doc python3-tk python3-setuptools tix xvfb python-bluez python-gobject python-dbus python cython python-doc python-tk python-numpy python-scipy python-qt4 python3-pyqt5 python3-pyqt5.q* python3-qtpy python-pyqt5.q* python-lxml fontconfig python-demjson qt5-default libqt5webkit5-dev build-essential libudev-dev python-lxml libxml2-dev libxslt-dev libpq-dev python-pyside python-distlib python-pip python-setuptools" # python-examples python3-examples python-vte
allgoodpcks="ca-certificates virtualenv autotools-dev cdbs git expect libnss3-tools util-linux xvfb curl bridge-utils chromium-browser chromium-chromedriver firefox-esr"
sudo apt-get install --reinstall -y $pypcks $allgoodpcks
if [[ ! -f /usr/lib/chromium-browser/chromedriver ]]; then
sudo ln -s /usr/bin/chromedriver /usr/lib/chromium-browser/chromedriver
fi