Skip to content

Instantly share code, notes, and snippets.

View houshuang's full-sized avatar

Stian Håklev houshuang

View GitHub Profile
const express = require("express");
const axios = require('axios');
const app = express();
app.use(express.json());
const defaultFactor = 2.5
const defaultInterval = 2
const generateOutput = ({ factor, interval, due }) =>
@houshuang
houshuang / gist:cafda00d5104fdcc73004c3288514c55
Last active May 22, 2023 12:05
Process flight confirmation email and send to Tana
var express = require("express");
var http = require("http");
var app = express();
const prompt = (context) => `
TASK: Extract information from CONTEXT
OUTPUT FORMAT: as a JSON structure following the TYPESCRIPT DEFINITION. Output only a valid JSON structure.
type Node = {
const express = require("express");
const app = express();
app.use(express.json());
const defaultFactor = 2.5
const defaultInterval = 2
const generateOutput = ({ factor, interval, due }) =>
`[[date:${due.toISOString().slice(0, 10)}]] ${factor}/${interval}`;
- #[[Twitter thread]] [[Cedric Chin]]: Increasingly curious as to why the tools-for-thought folk talk a lot about note-taking tool features and plugins and not at all about the cognitive science of better externalised thinking. [*](https://twitter.com/ejames_c/status/1489418153449123841)
- An example of why paying attention to the cognitive science is important:
- https://twitter.com/add_hawk/status/1489001641051262981 [*](https://twitter.com/ejames_c/status/1489458699307728899)
- Also relevant: https://link.springer.com/article/10.1007/s00146-010-0272-8 [*](https://twitter.com/ejames_c/status/1489500343092547584)
- Also relevant (though this one demands some understanding of cognitive flexibility theory, and why learning in ill-structured domains is markedly different from structured domains): https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.89.4385&rep=rep1&type=pdf [*](https://twitter.com/ejames_c/status/1489511021018750980)
- For the record, I’m genuinely interested in thi
- This page is a collection of some of the Advanced queries from the [[Datalog]] channel on the [[Logseq/Discord]] server. #datalog
id:: 61db13f4-75e8-4f87-ad60-3ac3479c5fc8
- ### Resources
- [link: The first message on the datalog channel](https://discord.com/channels/725182569297215569/743139225746145311/743139795865174119)
- [link: Logseq docs - Advanced queries](https://docs.logseq.com/#/page/advanced%20queries)
- [link: Logseq datascript schema](https://gist.github.com/tiensonqin/9a40575827f8f63eec54432443ecb929)
- [link: Logseq frontend db model](https://github.com/logseq/logseq/blob/master/src/main/frontend/db/model.cljs)
- [link: How to Graph Your Data - talk by Paula Gearon](https://youtu.be/tbVwmFBnfo4)
- [link: Domain modelling with datalog - talk by Norbert Wojtowicz](https://youtu.be/oo-7mN9WXTw)
- [link: Athens Research ClojureFam](https://github.com/athensresearch/ClojureFam)
@houshuang
houshuang / gist:93a320a5b3d447d13613735be2d68bec
Last active June 26, 2021 08:15
Roam JS for putting a page/block on your left sidebar
// MIT Licensed
// Author: jwilson8767
/**
* Waits for an element satisfying selector to exist, then resolves promise with the element.
* Useful for resolving race conditions.
*
* @param selector
* @returns {Promise}
*/
- {{[[roam/css]]}}
- ```css
.roam-block-container>.rm-block-children {
margin-left: 0px;
}
.rm-level-0 > .rm-multibar {
left: 0px;
}
.rm-level-1 > .rm-multibar {
left: -8px;
(ns myTablev03
(:require
[reagent.core :as r]
clojure.pprint
[datascript.core :as d]
[roam.datascript.reactive :as dr]))
(defn rand-str [len]
(apply str (take len (repeatedly #(char (+ (rand 26) 65))))))
@houshuang
houshuang / srs.css
Created January 5, 2021 08:09
Put in your roam/css - SRS enhancements
- Hide tags with [[css/minimal]]
- ```css
#min-title = hides the page reference link / page title
#min-con = hides the contextual reference information (breadcrumbs)
#minimal = hides both the title and the context
#min-q = hides the query string, similar to legacy behavior
#min-all = hides everything — title, context, and query string
inspired by Matt Goldenberg */
const addFavicons = () => {
let filtered = Array.prototype.filter.call(document.querySelectorAll('.roam-body a'), a => {
return a.hostname && a.hostname !== document.location.hostname;
});
Array.prototype.forEach.call(filtered, a => {
if (a.text == "*") {
a.style.background = `url(https://www.google.com/s2/favicons?sz=16&domain=${a.hostname}) right center no-repeat`;
a.style.paddingRight = "18px";
} else {
a.style.background = `url(https://www.google.com/s2/favicons?sz=16&domain=${a.hostname}) left center no-repeat`;