This file contains hidden or 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
You are a pairing buddy helping another software engineer to build a SaaS to let users deploy their own OpenWebUI instances. The software or platform for you to execute this are: | |
- Open Web UI | |
- LiteLLM - to store user's API keys and serving OpenAI compatible endpoint for OpenWebUI | |
- Coolify - to deploy user's Open Web UI instances using its API | |
- Clerk - to provide auth - https://clerk.com | |
- Polar - to provide payments - https://polar.sh | |
Built upon: | |
- FastAPI - backend API | |
- Typer - CLI framework for background services |
This file contains hidden or 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
#! /bin/sh | |
# Attempt to guess a canonical system name. | |
# Copyright 1992-2024 Free Software Foundation, Inc. | |
# shellcheck disable=SC2006,SC2268 # see below for rationale | |
timestamp='2024-07-27' | |
# This file is free software; you can redistribute it and/or modify it | |
# under the terms of the GNU General Public License as published by |
This file contains hidden or 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
class Candle(BaseCutsModel): | |
open_time: int | |
open: Decimal | |
high: Decimal | |
low: Decimal | |
close: Decimal | |
volume: Decimal | |
close_time: int | |
quote_asset_volume: Decimal | |
number_of_trades: int |
This file contains hidden or 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 os import environ | |
from typing import Optional, Dict | |
from datetime import datetime, timedelta | |
import requests | |
API_URL = 'https://api.clevertap.com' | |
API_EVENTS_URI = '/1/events.json' | |
MAX_BATCH_SIZE = 5000 | |
PROJECT_ID = environ.get('PROJECT_ID') | |
PASSCODE = environ.get('PASSCODE') |
This file contains hidden or 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 datetime import datetime | |
import csv | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
fn = './redfin_2019-08-08-20-18-37.csv' | |
fn_mapped = './redfin_2019-08-08-20-18-37-mapped.csv' | |
df = [] | |
with open(fn) as f: |
This file contains hidden or 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
<!DOCTYPE html> | |
<html><head> | |
<noscript> | |
<meta http-equiv="refresh"content="0;URL=http://ibn.adreach.co/ads-request?t=3&j=0&i=182324434&s=I03025149477501061917&a=http://www.livescore.com/"/> | |
</noscript> | |
<link href="http://ibn.adreach.co:8004/COMMON/css/ibn_20150915.css" rel="stylesheet" type="text/css"> | |
<script type="text/javascript" src="http://ibn.adreach.co/ads-request?t=3&j=2&callback=ibn.jsonp313&rnd=313&a=http%3A%2F%2Fwww.livescore.com%2F&i=182324434&s=I03025149477501061917"></script><style type="text/css"> | |
:root #content > #center > .dose > .dosesingle, | |
:root #content > #right > .dose > .dosesingle | |
{ display: none !important; }</style><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="apple-mobile-web-app-capable" content="no"><title>LiveScore Soccer : Live Soccer Scores by LiveScore.com</title><script type="text/javascript" src="http://ibn.adreach.co/ads-reset?j=2&adsTransactionId=D0394775012212561&orgUrl=http%3A%2F |
This file contains hidden or 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
$ python hs.py | |
**/ Benchmarking Handlersocket - START /** | |
Elapsed time: 9.35 seconds | |
Speed : 10693.14 queries/second | |
**/ Benchmarking Handlersocket - END /** | |
**/ Benchmarking MySQL - START /** | |
Elapsed time: 12.11 seconds |
This file contains hidden or 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 pyhs import Manager | |
import MySQLdb | |
import time | |
def run_handlersocket(maximum): | |
hs = Manager() # Assuming that Handlersocket is available at 127.0.0.1 | |
print '**/ Benchmarking Handlersocket - START /**\n' |
This file contains hidden or 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 pyhs import Manager | |
def main(): | |
hs = Manager() # Assuming that Handlersocket is available at 127.0.0.1 | |
user = hs.find('fun', 'user', '>=', ['user_id', 'user_name', 'user_email', 'created'], ['tistaharahap'], 'usernames', 1) | |
print dict(user[0]) |
This file contains hidden or 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
CREATE INDEX usernames ON `user` (user_name); |
NewerOlder