Skip to content

Instantly share code, notes, and snippets.

@cldwalker
cldwalker / page-property-join-example-query
Created Jan 31, 2022
logseq page-property-join-example-query
View page-property-join-example-query
- #+BEGIN_QUERY
{:title "Query joining page properties with a rule"
:query [:find (pull ?things [*])
:in $ ?region %
:where
(page-name-property ?_b ?country :region ?region)
(page-name-property ?_b2 ?author :country-of-origin ?country)
(page-name-property ?things ?_name :authored-by ?author)]
:inputs ["Middle East"
[[(page-name-property ?b ?block-name ?property-name ?property-value)
@cldwalker
cldwalker / logseq-join-query.md
Last active Jan 31, 2022
Example logseq queries of joining across blocks by user defined properties
View logseq-join-query.md

This gist demonstrates joining across user defined block properties. To start, paste the following 3 blocks in Logseq:

- type:: person
  name:: foo
- type:: comment
  author:: foo
  text:: bar
- #+BEGIN_QUERY
  {:title "Query joining blocks by user defined properties"
@cldwalker
cldwalker / explore_datafy_nav.clj
Created Aug 11, 2020 — forked from sashton/explore_datafy_nav.clj
Clojure datafy/nav exploration
View explore_datafy_nav.clj
(ns explore-datafy-nav
"Sample code demonstrating naving around a random graph of data.
The graph very likely will have circular references, which is not a problem.
To see the results, execute the entire file.
Each step in the nav process will be printed out, as well as the initial db.
Subsequent executions will generate a new random db."
(:require [clojure.datafy :refer [datafy nav]]
[clojure.pprint]))
(defn generate-db
@cldwalker
cldwalker / spike-day-02-03-20.md
Last active Sep 27, 2021
GraalVM dive in Clojure at work
View spike-day-02-03-20.md

Spike

I looked into the state of GraalVM and Clojure and wrote some small work-related scripts.

GraalVM Build Tools

@cldwalker
cldwalker / knowledge-graph-experiment.md
Last active May 11, 2022
knowledge graph experiment
View knowledge-graph-experiment.md

I like to learn, index and retrieve information a lot. I know a lot of others do as well. We share data but I don't think we share our information and rarely our ontologies (a.k.a. our mental models). If we shared our ontologies, I think we could learn more from each other. With this hope in mind, I'm looking for a tool that provides these features:

  • Shares my ontology publicly
  • Shares my bookmarks publicly
  • Provides easy entry, extension and querying of my ontology
  • Provides easy entry and querying of my bookmarks
  • Shares interesting snapshots of my bookmarks
  • Encourages discovery of information that is new and interesting to others

Since I have not found such a tool, I have built a tool that:

@cldwalker
cldwalker / gist:3043504e79c389bec5ebd2a4f4fa8a57
Last active Apr 29, 2020
ClojureScript ReactNative Unsession
View gist:3043504e79c389bec5ebd2a4f4fa8a57
View when-let-lol.clj
(defroutes chapter-routes
;; Example story-slug: 42-my-first-story
;; Example chapter-slug: 99-introduction
;; (util/parse-uid "42-my-first-story") -> 42
;; (util/parse-uid "99-introduction") -> 99
(GET "/chapters/:chapter-slug" [story-slug chapter-slug]
(let [story (some-> story-slug util/parse-uid db/find-story-by-uid)
chapter (some-> chapter-slug util/parse-uid db/find-chapter-by-uid)]
(and story chapter
(zizkov.views/show-chapter layout story chapter)))))
@cldwalker
cldwalker / gist:4690642
Created Feb 1, 2013
Example lein grep search
View gist:4690642
Searching over Artifact ID...
+----------------------+-------------------------------+----------------+-----------------------------------------------------------------------------------------------------------------------------+
| artifact | group | version | desc |
+----------------------+-------------------------------+----------------+-----------------------------------------------------------------------------------------------------------------------------+
| lein-create-template | lein-create-template | 0.1.1 | A Leiningen plugin for creating templates from existing skeleton projects |
| lein-template | misaki | 0.0.1-alpha | FIXME: write description
@cldwalker
cldwalker / rails-overview.rb
Created Jul 20, 2011
Prints out a tree of classes and their methods for a rails project
View rails-overview.rb
#!/usr/bin/env ruby
# == Description
# Prints out a tree of classes and their methods for a rails project. Can be run from the
# root directory of a rails project or with a specified rails directory. By default
# this script only looks in the models, controllers and helpers directories for ruby classes but that can be
# configured.
#
# This was useful back in the day when Rails projects were small and I wanted to a quick overview of
# the project.