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 / Texify-Mathjax.user.js
Created March 1, 2024 02:42 — forked from arshsingh/Texify-Mathjax.js
A Tampermonkey / Greasemonkey script that turns LaTeX code on page into mathematical symbols using MathJax
// ==UserScript==
// @name TeXify the World MathJax
// @namespace
// @version 1.0
// @description Enables MathJax to process LaTeX on all websites. Based off SOUP (Stack Overflow Unofficial Patch) and http://www.math.ucla.edu/~robjohn/math/mathjax.html.
// @include *
// @copyright
// ==/UserScript==
/*
var mathjaxVersion = "http://cdn.mathjax.org";
@iqiancheng
iqiancheng / hdiutil.txt
Created February 26, 2024 07:34 — forked from NapoleonWils0n/hdiutil.txt
macosx: hdiutil creating disk images
hdiutil
Creating Internet-enabled Disk images
hdiutil internet-enable -yes /Path/to/image/myapp.dmg
burn an iso
@iqiancheng
iqiancheng / wsj.user.js
Created February 22, 2024 02:24 — forked from casbeebc/wsj.user.js
Wall Street Journal Paywall bypass
/* jshint esversion: 6 */
// ==UserScript==
// @name WSJ and Barrons Paywall Hack - No Popup Confirmation
// @description Paywall bypass for WSJ and Barrons without any confirmation popup
// @match https://www.wsj.com/*
// @match https://www.barrons.com/*
// @run-at document-end
// @grant none
// @version 1
// ==/UserScript==
@iqiancheng
iqiancheng / medium.user.js
Created February 19, 2024 07:42 — forked from mathix420/medium.user.js
Bypass Medium Paywall - Working late 2023 - Greasy Fork, Violentmonkey, Tampermonkey
// ==UserScript==
// @name Medium Paywall Bypass
// @namespace Violentmonkey Scripts
// @run-at document-start
// @match *://*.medium.com/*
// @match *://medium.com/*
// @match *://*/*
// @grant none
// @version 2.1
// @inject-into content
@iqiancheng
iqiancheng / README.md
Last active January 30, 2024 12:25
一行式Check if MPS is Available

If you want to check MPS availability using a one-liner in the command line, you can use the following:

python3 -c "import torch; print(f\"MPS is {'' if torch.backends.mps.is_available() else 'not '}available\") "

This one-liner imports the torch module, checks if MPS is available, and prints the corresponding message.

python3 -c "import torch; print(torch.backends.mps.is_available())"
@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 / 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==
@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