Skip to content

Instantly share code, notes, and snippets.

@leonmak
leonmak / lc-locked.csv
Created February 1, 2019 05:41
leetcode locked questions
id difficulty title
253 Medium Meeting Rooms II
269 Hard Alien Dictionary
681 Medium Next Closest Time
159 Hard Longest Substring with At Most Two Distinct Characters
642 Hard Design Search Autocomplete System
158 Hard Read N Characters Given Read4 II - Call multiple times
683 Hard K Empty Slots
716 Easy Max Stack
755 Medium Pour Water
@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