Prerequisites:
- Heroku CLI installed on your computer
- A project deployed to Heroku
| (ns docker-tag-paginate | |
| (:require [clj-http.lite.client :as client] | |
| [cheshire.core :as json] | |
| [clojure.pprint :refer [print-table]])) | |
| (def base-url "https://registry.hub.docker.com/v2") | |
| ;; (progression pos? dec 15) | |
| (defn progression |
| "************************************************************************** | |
| * Allowable characters: * | |
| * - a-z * | |
| * - A-Z * | |
| * - 0-9 * | |
| * - .+/\*~<>@%|&? * | |
| * - blank, tab, cr, ff, lf * | |
| * * | |
| * Variables: * | |
| * - variables must be declared before use * |
| #!/usr/bin/env lumo | |
| (ns spacedl.spacedl | |
| (:require [cljs.nodejs :as node] | |
| [clojure.pprint :refer [pprint]] | |
| [clojure.string :as string :refer [join split starts-with?]] | |
| [cljs.core :refer [*command-line-args*]])) | |
| (node/enable-util-print!) | |
| (.on js/process "uncaughtException" #(js/console.error %)) |
Prerequisites:
This is a simplified, but fairly thorough, set of scripts and configuration to enable Heroku Release Phase for Rails apps.
Further, this particular set up plays nicely with Heroku Review Apps in that the release phase script will:
bin/rails db:version) is 0.For a "normal" app that usually means it will run the DB migrations.
I looked into the state of GraalVM and Clojure and wrote some small work-related scripts.
| .ONESHELL: | |
| test: .SHELLFLAGS := -i | |
| test: SHELL := bb | |
| test: | |
| (println :wow) | |
| (require '[clojure.string :as s]) | |
| (s/reverse (slurp "./Makefile")) | |
In my application every time I send a newsletter to a User, I create a NewsletterDelivery record. I frequently want to be able to query, for each user, what is the most recent newsletter delivery record. This is called a "last n per group" query and a LATERAL JOIN is the best way to do it imo. But the query I've been using (and I've told people to use, and seen blogged about) is not very good, because the conditions don't get pushed down into the subselect which means that the query ends-up lateral-joining all the records before it applies the conditions for the association.
Instead of doing subselect_table.* the better query does association.id AS assocation_id, subselect_table.id, subselect_table.title, .... and enumerates over all of the columns. This allows the association query, which Active Record tacks on at the end as WHERE association_id = $1 or WHERE association_id IN ($1, $2, $3, ...) to be pushed down c