Skip to content

Instantly share code, notes, and snippets.

View kkdai's full-sized avatar

Evan Lin kkdai

View GitHub Profile
@kkdai
kkdai / git-commit-styleguide.md
Created January 2, 2025 07:29 — forked from rishavpandey43/git-commit-styleguide.md
This gist consist of the rules and best practice of good conventional git commit message

Git Commit Messages Style-Guides

  • Use the present tense ("Add feature" not "Added feature")
  • Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
  • Limit the first line to 72 characters or less
  • Reference issues and pull requests liberally after the first line
  • When only changing documentation, include [ci skip] in the commit title
  • Consider starting the commit message with an applicable emoji

Types

ffmpeg -i source.mp4 -vf "subtitles=tw2.srt:force_style='FontName=Arial'" -c:a copy output.mp4
import openai
import argparse
import os
openai.api_key = os.getenv("OPENAI_API_KEY")
def translate_text(text, source_language="ja", target_language="zh"):
response = openai.ChatCompletion.create(
model="gpt-4o-mini",
@kkdai
kkdai / youtubeloader.ipynb
Created October 5, 2024 14:40
YouTubeLoader
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""xml2json.py Convert XML to JSON
Relies on ElementTree for the XML parsing. This is based on
pesterfish.py but uses a different XML->JSON mapping.
The XML->JSON mapping is described at
http://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html
@kkdai
kkdai / gemini-cf.go
Created April 12, 2024 13:16
LINE Bot Cloud Function - demo code in Go
package helloworld
import (
"context"
"fmt"
"net/http"
"io"
"log"
"os"
# package>=version
line-bot-sdk
requests
git+https://github.com/ozgur/python-firebase
google.generativeai
from linebot import LineBotApi, WebhookHandler
from linebot.models import TextSendMessage
import json
import os
from firebase import firebase
import google.generativeai as genai
# 使用環境變量讀取憑證
token = os.getenv('LINE_BOT_TOKEN')
@kkdai
kkdai / github-isssue-rag-langchain.ipynb
Last active February 21, 2024 03:36
Github Issues LangChain RAG Q&A 的 Colab
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kkdai
kkdai / devday2023.ipynb
Created November 8, 2023 16:04
devday2023.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.