Skip to content

Instantly share code, notes, and snippets.

View a-yasui's full-sized avatar
🐆
にゃおす

a.yasui a-yasui

🐆
にゃおす
View GitHub Profile
@hideokamoto
hideokamoto / hono.ts
Last active April 16, 2024 09:47
Cloudflare Workers (with Hono)で、WordPressの記事情報を使ったRAGを作るサンプル
import { Hono } from 'hono'
import { CloudflareVectorizeStore } from "langchain/vectorstores/cloudflare_vectorize";
import { OpenAIEmbeddings } from "langchain/embeddings/openai";
import { ChatOpenAI } from "langchain/chat_models/openai";
import { Document } from 'langchain/document';
import {
RunnablePassthrough,
RunnableSequence,
} from "langchain/schema/runnable";
import { StringOutputParser } from "langchain/schema/output_parser";
@arikfr
arikfr / README.md
Last active April 13, 2024 15:57
Setting up HTTPS with LetsEncrypt for Redash Docker Deployment
  1. Make sure the domain you picked points at the IP of your Redash server.
  2. Switch to the root user (sudo su).
  3. Create a folder named nginx in /opt/redash.
  4. Create in the nginx folder two additional folders: certs and certs-data.
  5. Create the file /opt/redash/nginx/nginx.conf and place the following in it: (replace example.redashapp.com with your domain name)
    upstream redash {
        server redash:5000;
    }
    
%
% hanmen.sty
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{hanmen}[2023/11/06 v0.9.8]
\RequirePackage{xkeyval,calc,xcolor,iftex}
%% 文字サイズ指定用単位定義
\newdimen\bQ
@mattes
mattes / default.conf
Last active June 4, 2022 06:43
redash.io setup
upstream redash {
server redash:5000;
}
server {
listen 80;
location / {
return 301 https://$host$request_uri;
}
@Caffe1neAdd1ct
Caffe1neAdd1ct / mailhog-install.sh
Last active August 25, 2023 21:11
Installation of MailHog on CentOS 7
## Install packages
sudo yum install wget curl vim epel-release
sudo yum install daemonize.x86_64
## Install mailhog
wget https://github.com/mailhog/MailHog/releases/download/v0.2.0/MailHog_linux_amd64
sudo chmod +x MailHog_linux_amd64
sudo chown root:root MailHog_linux_amd64
sudo mv MailHog_linux_amd64 /usr/sbin/mailhog
@thomasjsn
thomasjsn / laravel-queue.service
Last active March 12, 2024 08:31
Laravel queue worker using systemd.
# Laravel queue worker using systemd
# ----------------------------------
#
# /lib/systemd/system/queue.service
#
# run this command to enable service:
# systemctl enable queue.service
[Unit]
Description=Laravel queue worker
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
# Before Script
before_script:
- composer self-update
- composer install --prefer-dist > /dev/null
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:refresh
# Services
services:
@asev
asev / bitbucket_load_all_diffs.js
Created July 14, 2015 05:43
Bitbucket load all diffs in pull request
/* Add this line to bookmarks and use when you see
* "Oops! You've got a lot of code in this diff and it couldn't load with the page."
* on a pull request at Bitbucket.
*/
javascript:(function(){[].forEach.call(document.querySelectorAll(".load-diff"),function(a){a.click()})})();
@tiarno
tiarno / gist:8a2995e70cee42f01e79
Last active February 2, 2024 22:15
find PDF font info with PyPDF2, example code
from PyPDF2 import PdfFileReader
from pprint import pprint
def walk(obj, fnt, emb):
'''
If there is a key called 'BaseFont', that is a font that is used in the document.
If there is a key called 'FontName' and another key in the same dictionary object
that is called 'FontFilex' (where x is null, 2, or 3), then that fontname is
embedded.