Skip to content

Instantly share code, notes, and snippets.

View aidistan's full-sized avatar

Aidi Tan aidistan

View GitHub Profile
@aidistan
aidistan / add_shortcuts_to_ZhiXueYun.js
Created September 5, 2022 01:30
Add keyboard shortcuts to Zhi Xue Yun platforms, such as www.csscdx.com
// 快捷键加持 for 中国船舶党校 (https://www.csscdx.com/)
document.addEventListener("keydown", (event) => {
if (event.key == "1") {
$("[value=0]")[0].click()
} else if (event.key == "2") {
$("[value=1]")[0].click()
} else if (event.key == "3") {
$("[value=2]")[0].click()
} else if (event.key == "4") {
$("[value=3]")[0].click()
@aidistan
aidistan / empty_Notion_trash.js
Created September 5, 2022 01:27
Empty the Notion trash
(function () {
const initWithBody = (body = {}) => {
return {
"credentials": "include",
headers: {
"accept": "*/*",
"cache-control": "no-cache",
"content-type": "application/json",
"pragma": "no-cache",
"sec-fetch-mode": "cors",
@aidistan
aidistan / .editorconfig
Created September 5, 2022 00:56
My .editorconfig
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
@aidistan
aidistan / add_progressbars_into_PPT_slides.vbs
Last active September 5, 2022 00:55 — forked from PiiXiieeS/Insert a progress bar to Powerpoint presentation .md
Add a progress bar to each PowerPoint slide
'' Go to "Development Tools > Macro > Visual Basic Editor", select "Insert >
'' Module", copy following text in the blank page. Then choose "File > Close
'' > Return to PPT", go to "Tools > Macro > Macros", then select AddProcessBar
'' and press Execute.
Sub AddProgressBar()
On Error Resume Next
With ActivePresentation
sHeight = .PageSetup.SlideHeight - 10
n = 0
@aidistan
aidistan / convert_Notion_to_md.rb
Last active September 5, 2022 01:04
Convert Notion block objects to markdown
require 'notion-sdk-ruby'
class Notion::Block
def to_md
prefix = ''
suffix = ''
case type
when 'paragraph'
# do nothing