Skip to content

Instantly share code, notes, and snippets.

@zklhp
zklhp / chat_with_Raven.py
Created April 11, 2023 01:40
Use rwkv.cpp to talk with Raven model
# python -i chat_with_Raven.py rwkv.cpp-14B-Q4_1_O.bin
import os
import argparse
import pathlib
import sampling
import tokenizers
import rwkv_cpp_model
import rwkv_cpp_shared_library
@zklhp
zklhp / Close-uselesstabs-in-163-mail.user.js
Last active November 10, 2021 12:35
Close useless tabs in 163 mail
// ==UserScript==
// @name Close useless tabs in 163 mail
// @namespace https://github.com/zklhp
// @icon https://mail.163.com/favicon.ico
// @version 3.3.0
// @description Close useless tabs
// @homepageURL https://gist.github.com/zklhp/c1a358f026358786bef58b49f65d8333
// @updateURL https://gist.github.com/zklhp/c1a358f026358786bef58b49f65d8333/raw/Close-uselesstabs-in-163-mail.user.js
// @author Chris Zheng <https://chriszheng.science/>
// @match *://mail.163.com/*
@zklhp
zklhp / xuexicn-study-automatically.user.js
Last active June 21, 2019 06:36
xuexi.cn study automatically UserScript
// ==UserScript==
// @name xuexi.cn study automatically
// @namespace https://github.com/zklhp
// @icon https://www.xuexi.cn/favicon.ico
// @version 1.1.7
// @homepageURL https://gist.github.com/zklhp/feddc94e4cf53d01091203413ec4e893
// @updateURL https://gist.github.com/zklhp/feddc94e4cf53d01091203413ec4e893/raw/xuexicn-study-automatically.user.js
// @description With this, you can view articles and videos automatically on xuexi.cn
// @author Chris Zheng <https://chriszheng.science/>
// @grant unsafeWindow
@zklhp
zklhp / Makefile
Last active November 16, 2018 18:34
Markdown to MS Word using Pandoc, with the existing .docx as template
# Markdown to MS Word using Pandoc, with the existing .docx as template
# Author: Chris Zheng
# URL: https://chriszheng.science/2017/11/09/Pandoc-2-and-my-workflow/
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@zklhp
zklhp / upload-github-release-asset.sh
Created August 7, 2017 09:40 — forked from stefanbuck/upload-github-release-asset.sh
Script to upload a release asset using the GitHub API v3.
#!/usr/bin/env bash
#
# Author: Stefan Buck
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
#
#
# This script accepts the following parameters:
#
# * owner
# * repo
@zklhp
zklhp / install-shadowsocks-libev.sh
Last active March 26, 2018 19:50
Install shadowsocks-libev on Debian 9
#!/bin/bash
# Usage:
# bash <(curl -s https://gist.githubusercontent.com/zklhp/98b91192aa055f47da6f7db518523236/raw/)
# Upgrade to Debian 9.0 (stretch) if needed.
grep ^8 /etc/debian_version && sed -i 's/jessie/stretch/g' /etc/apt/sources.list
cat <<EOF > /etc/apt/sources.list.d/stretch-stable-bpo.list
deb http://ftp.debian.org/debian stable-bpo main