Skip to content

Instantly share code, notes, and snippets.

View chezou's full-sized avatar

Aki Ariga chezou

View GitHub Profile
@chezou
chezou / README.md
Created January 29, 2024 01:21
RAG Chatbot using Confluence

confluence-rag

This is a sample application for RAG (retrieval augmented generation) with Confluence data.

It depends on rye for package management.

Since gist doesn't allow to crete a directory, make sure to create confluence_rag directory and move Python files under it.

mkdir confluence_rag
@chezou
chezou / constraints.txt
Last active October 29, 2023 23:31
Blog recommendation with prelims and chroma
annotated-types==0.6.0
anyio==3.7.1
backoff==2.2.1
bcrypt==4.0.1
cachetools==5.3.2
certifi==2023.7.22
charset-normalizer==3.3.1
chroma-hnswlib==0.7.3
chromadb==0.4.15
click==8.1.7
diff --git a/prelims/handler.py b/prelims/handler.py
index d4d416d..014bc7d 100644
--- a/prelims/handler.py
+++ b/prelims/handler.py
@@ -1,16 +1,18 @@
from .post import Post
import os
-
+from pathlib import Path
@chezou
chezou / code-server.ipynb
Created July 17, 2020 00:56
code-server.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chezou
chezou / ex2-3_plot_saled_prediction.ipynb
Created May 27, 2020 02:56
Ex2-3_plot_saled_prediction.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chezou
chezou / github_vulns.py
Created December 25, 2019 09:08
GitHub SecurityVulnerabilities
import requests
class GitHubClient:
def __init__(self, apikey, session=None):
self.headers = {"Authorization": f"Bearer {apikey}"}
if not session:
self.sess = requests.Session()
else:
self.sess = session
@chezou
chezou / plot_prophet_with_mpl.py
Last active December 9, 2019 08:44
Plot Facebook Prophet without model
import matplotlib as mlp
import pandas as pd
mlp.use("agg")
from matplotlib import pyplot as plt
from matplotlib.dates import (
MonthLocator,
num2date,
AutoDateLocator,
AutoDateFormatter,
@chezou
chezou / mt2md.rb
Created December 1, 2019 13:48
hatena blog 2 markdown
#!/usr/bin/env ruby
# Forked from: http://hamasyou.com/blog/2014/02/13/movable-type-to-octopress/
require 'date'
require 'mustache'
require 'stringex'
require 'cgi'
require 'reverse_markdown'
@chezou
chezou / as_msgpack_stream.R
Last active October 26, 2019 13:05
Convert R data frame to msgpack stream
devtools::install_github("crowding/msgpack-r")
library(msgpack)
x <- data.frame(a=1:3, b=4:6)
conn <- gzfile("test.msgpack.gz", open="w+b")
apply(x, 1, function(x) {writeMsg(c(x, time=as.integer(Sys.time())), conn)})
flush(conn)
close(conn)