Vaadin Flow cheat sheets and flow diagrams
Started a project to put together the more intricate correlations that make the Vaadin Flow framework tick.
Vaadin Flow Cheat sheets and flow diagrams
First one is the navigation life cycle:
If you are interrested in hiring a consultant for the effective use of open source software on an enterprise grade, take a look around in the About section to see, what I have to offer.
Various snippets or code parts I found useful, so I keep them here for reference.
Started a project to put together the more intricate correlations that make the Vaadin Flow framework tick.
Vaadin Flow Cheat sheets and flow diagrams
First one is the navigation life cycle:
Since Maven Central changed the search I had to fix my helper script. Time to try out Babashka.
#!/usr/bin/env bb
(defn artifact [{:keys [g a v latestVersion]}]
(str g ":" a ":" (or v latestVersion)))
(defn query [q]
(let [query-params {:start 0 :rows 50}]
(if (str/includes? q ":")
(let [[g a] (str/split q #":" 2)]
(assoc query-params
:q (str "g:" g " AND " "a:" a)
:core "gav"))
(assoc query-params :q q))))
(defn request [q]
(-> (org.httpkit.client/get
"https://search.maven.org/solrsearch/select"
{:content-type "application/json"
:query-params (query q)})
deref
:body
(cheshire.core/parse-string true)
:response
:docs))
(assert (= 1 (count *command-line-args*)))
(let [[q] *command-line-args*]
(->> (request q)
(map artifact)
(run! prn)))
Same as with Groovy beforehand:
(defmacro map-of
[& xs]
`(hash-map ~@(mapcat (juxt keyword identity) xs)))
(let [a 1
b 2]
(println (map-of a b)))
; {:b 2, :a 1}
From time to time I have the need to get text from an image, when someone shares a screen-shot, but not the URL in it or when I want to copy code from a stopped youtube video. So ideally I want to select a region of my screen and turn that into text.
First install gocr and flameshot. Then create a script, that
runs gocr
and opens the resulting text (in my case I want to open
a terminal with vim
). E.g. ~/bin/ocr
:
#!/bin/sh
rxvt -e sh -c "gocr -i \"$1\" | vim -"
Then create a "desktop" entry for flameshot
to pick up.
~/.local/share/applications/ocr.desktop
:
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=.../bin/ocr %f
Name=OCR
Categories=Graphics;
(Note, that the path there is absolute, or you have to figure out, what works for you... I couldn't be bothered to look into this)
Then start flameshot gui
(I have that on my Print Screen
-key),
select the region to OCR, press CTRL-o
(or click the button to open
the screenshot with an application), then pick the OCR-Application from
the desktop entry, which then opens the text.