Skip to content

Instantly share code, notes, and snippets.

View RebornQ's full-sized avatar
👨‍💻
Working from Company

Reborn RebornQ

👨‍💻
Working from Company
View GitHub Profile
@Stella2211
Stella2211 / DeepFloyd_IF_VRAM12GB.py
Last active January 17, 2024 03:59
DeepFloyd IF for around 12GB of VRAM
# huggingface login
from huggingface_hub import login
login()
# load textencorder in 8bit quantized
from transformers import T5EncoderModel
from diffusers import DiffusionPipeline
import datetime
@ninehills
ninehills / chatglm-openai-api.ipynb
Last active April 16, 2024 01:15
chatglm-openai-api.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alswl
alswl / .github.test.com.htpasswd
Last active March 28, 2023 06:55
Simple proxy on Nginx for Github(and Github user content)
# /etc/nginx/.github.test.com.htpasswd
# htpasswd -nb user password
# PLEASE USE YOUR OWN PASSWORD
user:$apr1$zv2GRYuf$vknySgxsj3DfOav6cdRCv.
@ninehills
ninehills / chatpdf-zh.ipynb
Last active April 9, 2024 06:40
ChatPDF-zh.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# STEP 1: Load
# Load documents using LangChain's DocumentLoaders
# This is from https://langchain.readthedocs.io/en/latest/modules/document_loaders/examples/csv.html
from langchain.document_loaders.csv_loader import CSVLoader
loader = CSVLoader(file_path='./example_data/mlb_teams_2012.csv')
data = loader.load()
@janlay
janlay / README.md
Last active April 16, 2023 16:27
OpenAPI Proxy for Cloudflare Workers
@noobnooc
noobnooc / cloudflare-worker-proxy.js
Last active June 25, 2024 09:44
cloudflare-worker-proxy
// Website you intended to retrieve for users.
const upstream = 'api.openai.com'
// Custom pathname for the upstream website.
const upstream_path = '/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = upstream
// Countries and regions where you wish to suspend your service.
@bookfere
bookfere / fix-google-translate-cn.sh
Last active July 5, 2024 00:24
Fix Google Translate CN for macOS
#!/bin/bash
# Copyright (c)2022 https://bookfere.com
# This is a batch script for fixing Google Translate and making it available
# in the Chinese mainland. If you experience any problem, visit the page below:
# https://bookfere.com/post/1020.html
set -e
IPS=(
74.125.137.90
@zhuziyi1989
zhuziyi1989 / URL Schemes.md
Last active July 16, 2024 13:58
常用 URL Schemes 收集。

** 由于此文年事已久,可能某些URL Schemes已失效,可在评论区留言指出!(最后更新于 2024.4.16)

关于 URL Scheme 你知道多少?

iOS系统中

由于苹果的各应用都是在沙盒中,不能够互相之间访问或共享数据。但是苹果还是给出了一个可以在APP之间跳转的方法:URL Scheme。简单的说,URL Scheme就是一个可以让 APP 相互之间可以跳转的协议。每个 APP 的URL Scheme都是不一样的,如果存在一样的URL Scheme,那么系统就会响应先安装那个 APP 的URL Scheme,因为后安装的 APP 的URL Scheme被覆盖掉了,是不能被调用的。

Android系统中

@xingstarx
xingstarx / MapDeserializerDoubleAsIntFix.java
Last active March 21, 2022 02:21
处理Gson中,json转换map造成的int变double的问题
/**
*最近在研究网络请求数据解析的问题,发现json数据被强制转换为map结构的时候,会出现int变成double的问题
*在stackoverflow上看到了一个这个How can I prevent gson from converting integers to doubles 的问题,采用了这个答案
*https://stackoverflow.com/a/36529534/5279354答案
*/
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;