Skip to content

Instantly share code, notes, and snippets.

View iqiancheng's full-sized avatar
🌴
On vacation

千橙 iqiancheng

🌴
On vacation
View GitHub Profile
@iqiancheng
iqiancheng / layernorm_vs_fused.py
Last active January 30, 2024 09:24 — forked from ptrblck/layernorm_vs_fused
layernorm_vs_fused
import torch
import torch.nn as nn
torch.backends.cudnn.benchmark = True
from apex.normalization import FusedLayerNorm
import time
@iqiancheng
iqiancheng / Mac下Python启动Downie下载视频.md
Created January 29, 2024 08:54
Mac下Python启动Downie下载视频

由于最近有一些下载视频的需求,用过youtube-dlyou-get硕鼠,但是都不是很满意,比如说腾讯视频:
youtube-dl:不支持

ERROR: Unsupported URL: https://v.qq.com/x/page/l0550bf7eei.html

you-get:莫名的报错,官方更新速度又慢,似乎得用you-get的fork版本Lulu

@iqiancheng
iqiancheng / export_bill_history.md
Last active January 19, 2024 08:15
常用:各银行流水查询及下载指南!

今天教大家,不管是支付宝,还是微信,亦或者各大银行……;一台手机,动动手指,在家即可自己打印明细:

电子版流水导出流程

①支付宝登录支付宝→账单→右上角三个小点→开具交易流水证明→用于材料证明→选择时间段→填写邮箱→流水会在24小时内发送至指定邮箱。(文件解压密码为身份证后6位)

②微信登录微信→钱包→右上角账单→右上角常见问题→下载账单→用作材料证明→选择时间段→填写邮箱→身份验证→密码验证→流水明细会在24小时内发送至指定邮箱。(文件密码将发送至微信支付公众号)

③中国银行登录中国银行APP→首页→更多→助手→交易流水打印→立即申请→选择账户→选择时间段→填写邮箱→申请记录→获得查询密码。

@iqiancheng
iqiancheng / compare_models.py
Created January 12, 2024 08:59
对比两个模型权重是否一致 torch.equal
import torch
model1 = torch.load('output/exp-step00000100/unet/diffusion_pytorch_model.bin')
print('load model1 success')
model1 = torch.load('output/exp-step00000100/unet/diffusion_pytorch_model.bin')
print('load model2 success')
def compare_models(dict1, dict2):
models_differ = False
for (key1, item1), (key2, item2) in zip(dict1.items(), dict2.items()):
if key1 == key2 and torch.equal(item1, item2):
pass
@iqiancheng
iqiancheng / zhihu_posts_datetime_top.user.js
Created January 11, 2024 11:28
修改知乎专栏文章发表时间的位置
// ==UserScript==
// @name 上移知乎文章发表日期到标题
// @namespace https://github.com/goocheez/GreasyFork/zhihu_timestamp_to_the_top
// @version 0.1
// @description 将知乎专栏的文章发表日期移动到标题下方
// @author Goocheez
// @match https://zhuanlan.zhihu.com/*
// @icon https://static.zhihu.com/heifetz/favicon.ico
// @grant none
// @license MIT
@iqiancheng
iqiancheng / arxiv-assistants.user.js
Last active January 10, 2024 05:38
Arxiv Assistants: HTML version of arxiv & AI chat for arxiv
// ==UserScript==
// @name Arxiv Assistants
// @namespace http://tampermonkey.net/
// @version 0.3.10
// @description HTML version of arxiv & AI chat for arxiv
// @author @iqiancheng
// @match https://arxiv.org/abs/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=arxiv.org
// @grant none
// @license MIT
@iqiancheng
iqiancheng / V2EX Polish.user.js
Created January 9, 2024 09:15
▲V2EX Polish - 体验更现代化的 V2EX 🟢
// ==UserScript==
// @name ▲V2EX Polish - 体验更现代化的 V2EX 🟢
// @namespace LeoKu(https://leoku.top)
// @version 1.8.6
// @description 一款专为 V2EX 用户设计的浏览器插件,提供了丰富的扩展功能,让原生页面焕然一新!✨
// @author LeoKu
// @match https://*.v2ex.com/*
// @match https://v2ex.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=v2ex.com
// @run-at document-start
@iqiancheng
iqiancheng / Preferences.sublime-settings
Last active December 25, 2023 03:53
Sublime Text4 用户设置模版
{
"auto_complete": true,
"auto_complete_delay": 500,
"auto_complete_size_limit": 4194304,
"bold_folder_labels": true,
"caret_extra_width": 2,
"font_size": 15,
"update_check": false,
"show_encoding": true,
"default_encoding": "UTF-8",
@iqiancheng
iqiancheng / tag_v2ex_username.user.js
Created December 18, 2023 09:24 — forked from y4code/tag_v2ex_username.js
给 V2EX 用户打标签
// ==UserScript==
// @name 给 V2EX 用户打标签
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.v2ex.com/*
// @match http*://*.v2ex.com/*
// @match http*://v2ex.com/*s
// @match https://v2ex.com/
@iqiancheng
iqiancheng / download-youtube-subtitles.user.js
Last active January 15, 2024 07:43 — forked from kugland/download-youtube-subtitles.js
Download YouTube subtitles (GreaseMonkey/TamperMonkey script)
// ==UserScript==
// @name Download YouTube subtitles
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Now you can download YouTube subtitles
// @author André Kugland
// @match http*://*.youtube.com/*
// @grant none
// @require https://cdn.jsdelivr.net/npm/file-saver@2.0.2/dist/FileSaver.min.js#sha256=bbf27552b76b9379c260579fa68793320239be2535ba3083bb67d75e84898e18
// ==/UserScript==