Skip to content

Instantly share code, notes, and snippets.

@leonmak
leonmak / test.json
Last active January 27, 2022 08:48
test
[
{
"id": "dateOfBirth",
"required": true,
"type": "date",
"question": "生年月日",
"format": "yyyy/MM/dd",
"min": "2008/01/02"
}
]
@leonmak
leonmak / test2.json
Last active September 5, 2022 04:30
test2.json
[
{
"id": "gender",
"type": "select",
"question": "Gender?",
"options": [
{
"value": "0",
"label": "Decline to answer"
},
@leonmak
leonmak / fetch-content.js
Created October 17, 2022 06:12
get-substack
const runner = ((links) => {
var parser = new DOMParser();
links.forEach(async link => {
const resp = await fetch(link)
const text = await resp.text()
const doc = parser.parseFromString(text, "text/html");
const title = doc.querySelector('.post-title').textContent;
const subtitle = doc.querySelector('.subtitle').textContent
const bodyHTML = doc.querySelector('.available-content').innerHTML;
const html = `<html>
@leonmak
leonmak / README.md
Last active November 10, 2023 13:11
how to setup matrix server dendrite

Docker

in ~/docker/matrix:

  • wget https://raw.githubusercontent.com/matrix-org/dendrite/main/build/docker/docker-compose.yml
  • edit docker-compose.yaml
    • to add postgres password
    • to add volume file below
      • ./config:/etc/dendrite for below config
      • ./:/mnt for keys in container, see below
  • edit config/dendrite.yaml