Skip to content

Instantly share code, notes, and snippets.

View HorseCheng's full-sized avatar

HorseCheng HorseCheng

  • Taiwan
View GitHub Profile
@HorseCheng
HorseCheng / PTTwidget.js
Created October 5, 2020 15:10
Scriptable app: PTT Widget for iOS14
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: black; icon-glyph: user-md;
let page="Gossiping"
let showline=15
let fontsize=15
let html= new Request("")
html.url="https://www.ptt.cc/bbs/"+page
@HorseCheng
HorseCheng / CheckableComboBox.py
Last active April 1, 2024 17:11
CheckableComboBox
from PyQt5.QtCore import QEvent, Qt
from PyQt5.QtGui import QFontMetrics, QPalette, QStandardItem
from PyQt5.QtWidgets import QComboBox, QStyledItemDelegate, qApp
class CheckableComboBox(QComboBox):
# Subclass Delegate to increase item height
class Delegate(QStyledItemDelegate):
def sizeHint(self, option, index):
size = super().sizeHint(option, index)
@HorseCheng
HorseCheng / earthquake.bat
Created April 3, 2024 17:55
地牛Wake up 通知腳本
python earthquake.py %1 %2
@HorseCheng
HorseCheng / mapreduce.py
Created August 15, 2024 17:06
langchain MapReduce
import gc
import os
import time
import natsort
import torch
import whisper
from langchain.chains import MapReduceDocumentsChain, ReduceDocumentsChain
from langchain.chains.combine_documents.stuff import StuffDocumentsChain
from langchain.chains.llm import LLMChain
@HorseCheng
HorseCheng / gist:955883ff93394cf22723adb93eda6344
Last active November 13, 2024 17:52
difflib.HtmlDiff with button
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<title></title>