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 | |
* |
(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] |
Fix is to link [email protected] as openssl
1069 cd /opt/homebrew/opt # OR WHEREVER?
1070 rm openssl
1071 ln -s [email protected] openssl
{:deps {clj-jgit/clj-jgit {:mvn/version "1.0.1"} | |
org.clojure/data.csv {:mvn/version "1.0.0"}}} |
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)
Some code to generate an SQLite dump from a database via a JDBC connection.
First we need a deps.edn
file
{:deps {org.clojure/java.jdbc {:mvn/version "0.7.12"}
org.xerial/sqlite-jdbc {:mvn/version "3.34.0"}
com.oracle.database.jdbc/ojdbc8 {:mvn/version "21.1.0.0"}}}
Put a clj-statechart somewhere in my mobile app! Learn from the process.
Certainly better for orchestrating interesting behaviour when compared with simple re-frame handlers. The registration process has lots of corner cases. More of those are covered. The code is by rights more maintainable. I was able to refactor as I expanded it with confidence. So lots of wins there.
Actions tend to be hardcoded to a specific use case. Primarily because they have to dispatch an event which the fsm expects.
(def machine
(fsm/machine
{:id ::traffic
:initial :red
:states {:red {:on {::tick :green}}
:green {:on {::tick :orange}}
:orange {:on {::tick :red}}}}))
(ns app.statecharts | |
(:require [app.utils :as utils] | |
[statecharts.core :as fsm] | |
[interop.anomalies :as anom] | |
[re-frame.core :as rf])) | |
; Guards | |
(defn offline? [state event] (not (get-in state [:db :app/online?]))) | |
(defn has-errors? [state event] (seq (utils/login-form-errors (get-in state [:db :app/login-form])))) | |
(defn incorrect? [state event] (anom/incorrect? (:data event))) |