A Python tool to extract and export Gmail emails to JSONL format using the Gmail API.
- Install dependencies:
pip install -r requirements.in
| /* | |
| * Generate AI Analysis (Requires AI-Gemini.js and Export To Markdown.ajs) | |
| * | |
| * Requires: | |
| * * jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/ | |
| * * AI-Gemini.js - | |
| * * Export to Markdown.ajs - https://gist.github.com/smileham/578bbbb88dc0ed5a1403f3b98711ec25 | |
| * | |
| * Version 1: Gemini API | |
| * |
I was struggling to compose datomic queries neatly. In the end I googled and found a blogpost which proposed a sane solution.
My motivation was an API endpoint with optional filters. I'd like my query include additional filters based on the args present.
Anyway, here's how my code ended up looking...
And the article: http://grishaev.me/en/datomic-query
Looking at some old code there were a couple of undesirable features. One particular code smell is a good motiviating example: handlers calling other handlers.
It encourages the developer to "register handlers as reusable components" but that's a pretty clumsy way to write utilties. Over time those util handlers were collecting barnicles and were becoming very hard to reason about or refactor.
With the advent of :fx we have a clean composable alternative with some desirables traits.
My app has three namespaces (app.handlers, app.actions and app.utils)
| (ns cnd.analyse-code | |
| "Use rewrite-clj zipper to walk code. | |
| Niggles | |
| * Doesn't use the (ns...) aliases to resolve aliases to full paths. | |
| " | |
| (:require [clojure.java.io :as io] | |
| [clojure.zip :as zip] |
This is a bit of a thought exercise. I doubt it’s perfect and I’m hoping for opinions and corrections with the goal of a well reasoned practical approach.
One way to look at type declarations in a static language is as a test which picks up potential incompatible code paths. E.g. data passed is incompatible with code.
In static languages the effort to write the test is reduced by virtue of being declared inline with the code and inference allows a few annotations to permeate - having said that we can achieve a similar results in Clojure.
Fix is to link openssl@1.1 as openssl
1069 cd /opt/homebrew/opt # OR WHEREVER?
1070 rm openssl
1071 ln -s openssl@1.1 openssl
| (ns db-spec.core | |
| (:require [clojure.java.jdbc :as j] | |
| [clojure.spec :as s]) | |
| (:import (java.sql Types))) | |
| (defn db-tables-raw | |
| [db-spec {:keys [catalog schemaPattern tableNamePattern]}] | |
| (j/with-db-metadata [meta db-spec] | |
| (j/metadata-result | |
| (.getTables meta catalog schemaPattern tableNamePattern (into-array String ["TABLE"]))))) |
| {:deps {clj-jgit/clj-jgit {:mvn/version "1.0.1"} | |
| org.clojure/data.csv {:mvn/version "1.0.0"}}} |
| provision: | |
| clojure -A:dev -m devops provision | |
| teardown: | |
| clojure -A:dev -m devops teardown | |
| cloud-on: | |
| clojure -A:dev -m devops cloud-on |