This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Debounced promise: | |
// Like lodash.debounce, but multiple calls to a debounced function | |
// will return the same promise so that they will be notified when the debounced function returns | |
// | |
// In case the deboucned value is a promise, the last promise value shall be returned. | |
function debounceFn(fn, timeout) { | |
let timer = undefined; | |
let resPromise = undefined; | |
let resolver = undefined; | |
let rejector = undefined; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Upgrade powershell | |
- https://learn.microsoft.com/zh-cn/powershell/scripting/whats-new/migrating-from-windows-powershell-51-to-powershell-7?view=powershell-7.3 | |
- https://github.com/PowerShell/PowerShell/releases/download/v7.3.6/PowerShell-7.3.6-win-x64.msi | |
- Also add the shell to Terminal | |
- chocolatey | |
- cmd | |
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" | |
- powershell | |
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) | |
- startship |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@charset "utf-8";/*! tailwindcss v2.2.4 | MIT License | https://tailwindcss.com *//*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */*,::after,::before{box-sizing:border-box}html{-moz-tab-size:4;tab-size:4}html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}body{font-family:system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji'}hr{height:0;color:inherit}abbr[title]{text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Consolas,'Liberation Mono',Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function preparePageNodes() { | |
// id -> links | |
const pages = Array.from(currentWorkspace.docCollection.meta.docs).filter(p => p.title); | |
const edges = pages.flatMap((page) => | |
getPageLinks(page.id).map((target) => [page.id, target]) | |
); | |
return { | |
nodes: pages.map((page) => ({ id: page.id, label: page.title })), | |
edges: edges.map(([source, target]) => ({ source, target })), | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adopted from https://gist.github.com/neilcsmith-net/69bcb23bcc6698815438dc4e3df6caa3 | |
# INPUT_APPIMAGE must be absolute path | |
INPUT_APPIMAGE=$1 | |
# System architecture to create AppImage for - see options at https://github.com/AppImage/AppImageKit/releases/continuous/ | |
SYSTEM_ARCH="x86_64" | |
APPIMAGETOOL_URL="https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$SYSTEM_ARCH.AppImage" | |
TMP_DIR=$(mktemp -d) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as babel from "@babel/core"; | |
import * as fs from "fs"; | |
import plugin from "./plugin"; | |
const code = fs.readFileSync('./input.ts', 'utf8'); | |
const out = babel.transformSync(code, { | |
plugins: [plugin], | |
filename: './input.ts', | |
presets: [require.resolve("@babel/preset-typescript")], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async () => { | |
// make sure ZipTransformer is imported and attached to window | |
const { ZipTransformer } = window; | |
await Promise.all([...currentWorkspace.blockSuiteWorkspace.pages.values()].map(p => p.load())); | |
// wait for a few more seconds | |
await new Promise(resolve => setTimeout(resolve, 5000)); | |
const zipblob = await ZipTransformer.exportPages(currentWorkspace.blockSuiteWorkspace, [...currentWorkspace.blockSuiteWorkspace.pages.values()]); | |
const url = URL.createObjectURL(zipblob); | |
const a = document.createElement('a'); | |
a.setAttribute('href', url); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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); | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import url('https://cdn.jsdelivr.net/gh/pengx17/logseq-theme@master/custom.css'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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, | |
}); |
NewerOlder