Skip to content

Instantly share code, notes, and snippets.

View CHN-STUDENT's full-sized avatar
🇨🇳
Chinese Student

CHN-STUDENT CHN-STUDENT

🇨🇳
Chinese Student
View GitHub Profile
@padeoe
padeoe / README_hfd.md
Last active February 27, 2025 16:25
CLI-Tool for download Huggingface models and datasets with aria2/wget: hfd

🤗Huggingface Model Downloader

Note

(2025-01-08) Add feature for 🏷️Tag(Revision) Selection, contributed by @Bamboo-D.
(2024-12-17) Add feature for ⚡Quick Startup and ⏭️Fast Resume, enabling skipping of downloaded files, while removing the git clone dependency to accelerate file list retrieval.

Considering the lack of multi-threaded download support in the official huggingface-cli, and the inadequate error handling in hf_transfer, This command-line tool leverages curl and aria2c for fast and robust downloading of models and datasets.

Features

  • ⏯️ Resume from breakpoint: You can re-run it or Ctrl+C anytime.
@chenshengzhi
chenshengzhi / git_ssh_proxy.md
Last active February 27, 2025 13:32
git ssh 代理设置

仅为 GitHub 设置代理

git 代理

设置 git config --global http.https://git.521000.best.proxy socks5://127.0.0.1:1086
设置完成后, ~/.gitconfig 文件中会增加以下条目:

[http "https://github.com"]
    proxy = socks5://127.0.0.1:1086
@2efPer
2efPer / gist:8135d046a1c99dd3cd7d779745b30e89
Created November 20, 2017 03:28
convert sogou scel file to normal text file
# -*- coding: utf-8 -*-
import struct
import sys
import binascii
import pdb
#搜狗的scel词库就是保存的文本的unicode编码,每两个字节一个字符(中文汉字或者英文字母)
#找出其每部分的偏移位置即可
#主要两部分
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active February 28, 2025 00:51
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@staltz
staltz / introrx.md
Last active February 27, 2025 20:14
The introduction to Reactive Programming you've been missing
@pbojinov
pbojinov / README.md
Last active January 31, 2025 05:04
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe