This file contains 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 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 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 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 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 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 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/[email protected]/dist/index.js" | |
); | |
const workspace = window.currentBlockSuiteWorkspace; | |
const workspaceId = workspace.room; | |
const reader = getBlocksuiteReader({ | |
workspaceId: workspaceId, | |
Y: workspace.constructor.Y, | |
}); |
This file contains 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 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
let currentRepo = logseq.api.get_current_graph().path; | |
function isActive() { | |
return logseq.api.get_current_graph().path === currentRepo; | |
} | |
function isEditing() { | |
return logseq.api.check_editing(); | |
} |
This file contains 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
// make sure it doesn't count my own properties | |
(function () { | |
var results, currentWindow, | |
// create an iframe and append to body to load a clean window object | |
iframe = document.createElement('iframe'); | |
iframe.style.display = 'none'; | |
document.body.appendChild(iframe); | |
// get the current list of properties on window | |
currentWindow = Object.getOwnPropertyNames(window); | |
// filter the list against the properties that exist in the clean window |
NewerOlder