This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://jsfiddle.net/3an24jmw/25/ | |
asUtf16 = (str) -> | |
buffer = new ArrayBuffer(str.length * 2) | |
bufferView = new Uint16Array(buffer) | |
bufferView[0] = 0xfeff | |
for i in [0..str.length] | |
val = str.charCodeAt(i) | |
bufferView[i + 1] = val | |
bufferView |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function memorySizeOf(obj) { | |
var bytes = 0; | |
function sizeOf(obj) { | |
if(obj !== null && obj !== undefined) { | |
switch(typeof obj) { | |
case 'number': | |
bytes += 8; | |
break; | |
case 'string': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$") | |
ESLINT="$(git rev-parse --show-toplevel)/node_modules/.bin/eslint" | |
if [[ "$STAGED_FILES" = "" ]]; then | |
exit 0 | |
fi | |
PASS=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime, timedelta | |
from pytz import timezone | |
(datetime.now(tz=timezone('UTC'))+timedelta(minutes=WECHAT_QRCODE_EXPIRE_MINS)) | |
.astimezone(timezone('Asia/Shanghai')).strftime("%Y%m%d%H%M%S") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1beta2 | |
kind: Deployment | |
metadata: | |
name: backend3-deployment | |
labels: | |
cyouapp: backend3 | |
spec: | |
replicas: 2 | |
selector: | |
matchLabels: |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[31m[1m"[0m[31mThu, 02 Aug 2018 08:45:12 UTC: github.com/solo-io/gloo/pkg/function-discovery/eventloop/event_loop.go:122[0m[31m[1m"[0m beginning update for [][32mstring[0m{ | |
[31m[1m"[0m[31mgloo-system-control-plane-8081[0m[31m[1m"[0m, | |
[31m[1m"[0m[31mdefault-backend3-service-50051[0m[31m[1m"[0m, | |
[31m[1m"[0m[31mdefault-go-service-50051[0m[31m[1m"[0m, | |
[31m[1m"[0m[31mgloo-system-ingress-8080[0m[31m[1m"[0m, | |
[31m[1m"[0m[31mgloo-system-ingress-8443[0m[31m[1m"[0m, | |
} upstreams: [34m[1m5[0m | |
[31m[1m"[0m[31mThu, 02 Aug 2018 08:45:12 UTC: github.com/solo-io/gloo/pkg/function-discovery/eventloop/event_loop.go:122[0m[31m[1m"[0m beginning update for [][32mstring[0m{ | |
[31m[1m"[0m[31mdefault-go-service-50051[0m[31m[1m"[0m, | |
[31m[1m"[0m[31mgloo-system-ingress-8080[0m[31m[1m"[0m, |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[31m[1m"[0m[31mThu, 02 Aug 2018 08:45:12 UTC: github.com/solo-io/gloo/pkg/function-discovery/eventloop/event_loop.go:122[0m[31m[1m"[0m beginning update for [][32mstring[0m{ | |
[31m[1m"[0m[31mgloo-system-control-plane-8081[0m[31m[1m"[0m, | |
[31m[1m"[0m[31mdefault-backend3-service-50051[0m[31m[1m"[0m, | |
[31m[1m"[0m[31mdefault-go-service-50051[0m[31m[1m"[0m, | |
[31m[1m"[0m[31mgloo-system-ingress-8080[0m[31m[1m"[0m, | |
[31m[1m"[0m[31mgloo-system-ingress-8443[0m[31m[1m"[0m, | |
} upstreams: [34m[1m5[0m | |
[31m[1m"[0m[31mThu, 02 Aug 2018 08:45:12 UTC: github.com/solo-io/gloo/pkg/function-discovery/eventloop/event_loop.go:122[0m[31m[1m"[0m beginning update for [][32mstring[0m{ | |
[31m[1m"[0m[31mdefault-go-service-50051[0m[31m[1m"[0m, | |
[31m[1m"[0m[31mgloo-system-ingress-8080[0m[31m[1m"[0m, |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"log":"\u001b[31m\u001b[1m\"\u001b[0m\u001b[31mThu, 02 Aug 2018 08:45:12 UTC: github.com/solo-io/gloo/pkg/function-discovery/eventloop/event_loop.go:122\u001b[0m\u001b[31m\u001b[1m\"\u001b[0m\u0009beginning update for []\u001b[32mstring\u001b[0m{\n","stream":"stdout","time":"2018-08-02T08:45:12.476329889Z"} | |
{"log":" \u001b[31m\u001b[1m\"\u001b[0m\u001b[31mgloo-system-control-plane-8081\u001b[0m\u001b[31m\u001b[1m\"\u001b[0m,\n","stream":"stdout","time":"2018-08-02T08:45:12.476431785Z"} | |
{"log":" \u001b[31m\u001b[1m\"\u001b[0m\u001b[31mdefault-backend3-service-50051\u001b[0m\u001b[31m\u001b[1m\"\u001b[0m,\n","stream":"stdout","time":"2018-08-02T08:45:12.476445484Z"} | |
{"log":" \u001b[31m\u001b[1m\"\u001b[0m\u001b[31mdefault-go-service-50051\u001b[0m\u001b[31m\u001b[1m\"\u001b[0m,\n","stream":"stdout","time":"2018-08-02T08:45:12.476459084Z"} | |
{"log":" \u001b[31m\u001b[1m\"\u001b[0m\u001b[31mgloo-system-ingress-8080\u001b[0m\u001b[31m\u001b[1m\"\u001b[0m,\n","stream":"stdout","time":"2018-08-02T08:45:12.4764681 |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[31m[1m"[0m[31mThu, 02 Aug 2018 08:45:12 UTC: github.com/solo-io/gloo/pkg/function-discovery/eventloop/event_loop.go:122[0m[31m[1m"[0m beginning update for [][32mstring[0m{ | |
[31m[1m"[0m[31mgloo-system-control-plane-8081[0m[31m[1m"[0m, | |
[31m[1m"[0m[31mdefault-backend3-service-50051[0m[31m[1m"[0m, | |
[31m[1m"[0m[31mdefault-go-service-50051[0m[31m[1m"[0m, | |
[31m[1m"[0m[31mgloo-system-ingress-8080[0m[31m[1m"[0m, | |
[31m[1m"[0m[31mgloo-system-ingress-8443[0m[31m[1m"[0m, | |
} upstreams: [34m[1m5[0m | |
[31m[1m"[0m[31mThu, 02 Aug 2018 08:45:12 UTC: github.com/solo-io/gloo/pkg/function-discovery/eventloop/event_loop.go:122[0m[31m[1m"[0m beginning update for [][32mstring[0m{ | |
[31m[1m"[0m[31mdefault-go-service-50051[0m[31m[1m"[0m, | |
[31m[1m"[0m[31mgloo-system-ingress-8080[0m[31m[1m"[0m, |
NewerOlder