Skip to content

Instantly share code, notes, and snippets.

@pengx17
pengx17 / export.js
Last active January 23, 2026 04:40
Export app.affine.pro and import into AFFiNE client
(async () => {
async function blobToBase64(blob) {
return await new Promise((resolve) => {
const reader = new FileReader();
reader.onload = function() {
resolve(reader.result.split(',')[1]);
}
reader.readAsDataURL(blob);
});
}
@pengx17
pengx17 / footprints.js
Last active April 11, 2023 01:49
get blocksuite size footsprints
(async () => {
const { getBlocksuiteReader } = await import(
"https://unpkg.com/blocksuite-reader@0.0.6/dist/index.js"
);
const workspace = window.currentBlockSuiteWorkspace;
const workspaceId = workspace.room;
const reader = getBlocksuiteReader({
workspaceId: workspaceId,
Y: workspace.constructor.Y,
});
import jieba
import jieba.posseg as pseg
##打开分词文本文件fin,存放分词结果的文件fout
fin=open("test_chinese.txt",encoding='utf-8')
fout=open("result.txt",'w',encoding='utf-8')
##逐行读取分词文本文件fin
list=fin.readlines()
for listt in list:
@Chaser324
Chaser324 / GitHub-Forking.md
Last active February 12, 2026 23:11
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@diogojc
diogojc / pagerank.py
Created November 3, 2011 23:11
python implementation of pagerank
import numpy as np
from scipy.sparse import csc_matrix
def pageRank(G, s = .85, maxerr = .001):
"""
Computes the pagerank for each of the n states.
Used in webpage ranking and text summarization using unweighted
or weighted transitions respectively.