Skip to content

Instantly share code, notes, and snippets.

View chthollyphile's full-sized avatar

chthollyphile

View GitHub Profile
@chthollyphile
chthollyphile / asyncio_douban_zufang.py
Created February 15, 2022 14:35 — forked from cosven/asyncio_douban_zufang.py
北京豆瓣租房小脚本...
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
豆瓣租房爬虫
Install:
pip install beautifulsoup4
Usage:
@chthollyphile
chthollyphile / surfingkeys.txt
Last active August 7, 2022 08:51
chrome-surfingkeys-setting
// an example to create a new mapping `ctrl-y`
api.mapkey('<ctrl-y>', 'Show me the money', function() {
api.Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).');
});
// an example to replace `T` with `gt`, click `Default mappings` to see how `T` works.
api.map('gt', 'T');
// an example to remove mapkey `Ctrl-i`
api.unmap('<ctrl-i>');
@chthollyphile
chthollyphile / alist-download-env.bash
Last active March 18, 2023 14:50
alist-download-env
#!/bin/bash
# curl -fsSL https://gist.github.com/chthollyphile/d2a09d2b38483800439280cc82ccf943/raw/e67fce260037cee50ad82628b711c6987e5227b0/alist-download-env.bash | bash -s install
apt install -y python-is-python3
apt install -y pip
apt install -y ffmpeg
pip install yt-dlp
pip install ffmpeg
ufw disable
ips=`ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"`
curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s install
@chthollyphile
chthollyphile / submit.md
Created February 11, 2023 21:40 — forked from tanaikech/submit.md
Uploading Files to OneDrive Using Node.js

In order to use this script, please retrieve client id, client secret and refresh token before. About this, you can see the detail information at https://gist.github.com/tanaikech/d9674f0ead7e3320c5e3184f5d1b05cc.

1. Simple item upload

This is for the simple item upload is available for items with less than 4 MB of content. The detail information is https://dev.onedrive.com/items/upload_put.htm.

var fs = require('fs');
var mime = require('mime');
var request = require('request');
@chthollyphile
chthollyphile / run.ps1
Last active February 25, 2023 11:41
批量unpack亚马逊azw3格式电子书
# 先下载 https://github.com/kevinhendricks/KindleUnpack/releases,解压后,将本文件放置在 /KindleUnpack-XXX 文件夹下,与KindleUnpack.pyw同级
# 请确保已安装KindleUnpack需要的python版本,并且已更改powershell执行策略
# epub文件会被复制到 /KindleUnpack-XXX/output 文件夹中
$dirs = Read-Host 'Enter the directory that contains your DeDRM eBooks: '
Get-ChildItem $dirs | ForEach-Object -Process{
if($_ -is [System.IO.FileInfo])
{
$opt = $dirs+'\'+$_.Name+'UP'
mkdir $opt
@chthollyphile
chthollyphile / progressBar.py
Last active April 15, 2024 21:55
rich.progress with iterations per second
from rich.progress import Progress, ProgressColumn, SpinnerColumn, MofNCompleteColumn, Task ,Text
class IterationSpeedColumn(ProgressColumn):
"""Renders iterations per second, e.g. 1.14 it/s"""
def render(self, task: Task) -> Text:
last_speed = task.last_speed if hasattr(task, 'last_speed') else None
if task.finished and last_speed is not None:
return Text(f"{last_speed:.2f} it/s", style="progress.data.speed")
if task.speed is None: