jq is useful to slice, filter, map and transform structured json data.
brew install jq
import pandas as pd | |
from langchain.schema import Document | |
from langchain_community.embeddings import OllamaEmbeddings | |
from langchain_community.vectorstores import Chroma | |
from tqdm import tqdm |
MOZILLA/MDN/kuma master ✔ | |
▶ docker-compose up | |
Starting kuma_mysql_1 ... done | |
Starting kuma_redis_1 ... done | |
Starting kuma_elasticsearch_1 ... done | |
Recreating kuma_api_1 ... done | |
Recreating kuma_kumascript_1 ... done | |
Recreating kuma_web_1 ... done | |
Recreating kuma_worker_1 ... done | |
Attaching to kuma_redis_1, kuma_mysql_1, kuma_elasticsearch_1, kuma_api_1, kuma_kumascript_1, kuma_web_1, kuma_worker_1 |
__all__ = ['WriteToMongo'] | |
import json | |
from pymongo import MongoClient | |
from apache_beam.transforms import PTransform | |
from apache_beam.io import iobase | |
class _MongoSink(iobase.Sink): | |
"""A :class:`~apache_beam.io.iobase.Sink`.""" |
from __future__ import print_function | |
import requests | |
import json | |
import cv2 | |
addr = 'http://localhost:5000' | |
test_url = addr + '/api/test' | |
# prepare headers for http request | |
content_type = 'image/jpeg' |
# Public Domain CC0 license. https://creativecommons.org/publicdomain/zero/1.0/ | |
"""MongoDB Apache Beam IO utilities. | |
Tested with google-cloud-dataflow package version 2.0.0 | |
""" | |
__all__ = ['ReadFromMongo'] | |
import datetime |
https://pkgs.alpinelinux.org/package/main/x86_64/uwsgi-python
This is when trying to run uwsgi:
server_1 | open("./http_plugin.so"): No such file or directory [core/utils.c line 3675]
server_1 | !!! UNABLE to load uWSGI plugin: Error loading shared library ./http_plugin.so: No such file or directory !!!
server_1 | open("./python_plugin.so"): No such file or directory [core/utils.c line 3675]
# ATTENTION PLEASE! | |
# NOTE BY @riwazp7 | |
# Note for future visitors of this gist: Mac OS has Apache Benchmark by default ab --help | |
curl -OL http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz | |
tar -xzf libtool-2.4.2.tar.gz | |
cd libtool-2.4.2 | |
./configure && make && sudo make install | |
# brew install 'https://raw.github.com/simonair/homebrew-dupes/e5177ef4fc82ae5246842e5a544124722c9e975b/ab.rb' |
git stash save
git checkout -b xxx
git stash pop
where xxx
is the new branch name
import datetime as dt | |
class datetime(dt.datetime): | |
def __divmod__(self, delta): | |
seconds = int((self - dt.datetime.min).total_seconds()) | |
remainder = dt.timedelta( | |
seconds=seconds % delta.total_seconds(), | |
microseconds=self.microsecond, | |
) |