Skip to content

Instantly share code, notes, and snippets.

View mayneyao's full-sized avatar

Mayne mayneyao

View GitHub Profile
openapi: 3.0.0
servers:
- url: //petstore.swagger.io/v2
description: Default server
- url: //petstore.swagger.io/sandbox
description: Sandbox server
info:
description: |
This is a sample server Petstore server.
You can find out more about Swagger at
@mayneyao
mayneyao / vika_upload_files_example.py
Created February 7, 2022 11:04
批量上传附件到维格表
import os
import time
from vika import Vika
API_TOKEN = '你的 api token'
DST_ID = '存储图片的表id'
file_dir = '/Users/mayne/Desktop/demo' # 需要上图片的文件路径
vika = Vika(API_TOKEN)
@mayneyao
mayneyao / notion_api.js
Created February 18, 2019 09:59
Notion API
const axios = require('axios')
const { URLSearchParams } = require('url')
const getFullBlockId = (blockId) => {
if (typeof blockId !== 'string') {
throw Error(`blockId: ${typeof blockId} must be string`)
}
if (blockId.match("^[a-zA-Z0-9]+$")) {
return blockId.substr(0, 8) + "-"
+ blockId.substr(8, 4) + "-"
@mayneyao
mayneyao / eidos-ext.js
Last active September 12, 2023 20:26
Extension Mechanism Implementation of Web App Based on Wildcard Domains, OPFS, and Worker Communication
/**
* Welcome to Cloudflare Workers! This is your first worker.
*
* - Run "npm run dev" in your terminal to start a development server
* - Open a browser tab at http://localhost:8787/ to see your worker in action
* - Run "npm run deploy" to publish your worker
*
* Learn more at https://developers.cloudflare.com/workers/
*/
@mayneyao
mayneyao / eidos.py
Created September 18, 2023 20:02
eidos python sdk (wip)
import uuid
import requests
BASE_URL = "http://localhost:3333"
class DataSpace:
def __init__(self, space_id):
self.space_id = space_id
@mayneyao
mayneyao / notion2blog.js
Last active February 29, 2024 18:01
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",