This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns make-change | |
(:refer-clojure :exclude [==]) | |
(:require [clojure.core.logic :refer :all] | |
[clojure.core.logic.fd :as fd])) | |
(def ^:dynamic *coin-set* | |
{:penny 1 | |
:nickel 5 | |
:dime 10 | |
:quarter 25}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns metabase.test.generate | |
"Facilities for generating random instances of our various models." | |
(:require [metabase.models :refer [Card Dashboard DashboardCard]] | |
[metabase.test :as mt] | |
[methodical.core :as m] | |
[toucan.db :as db] | |
[toucan.util.test :as tt])) | |
(m/defmulti create-random!* | |
{:arglists '([model property-overrides])} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lein update-in : assoc :dependencies '^:replace [[org.clojure/clojure "1.10.1"] [org.liquibase/liquibase-core "3.5.5"] [org.postgresql/postgresql "42.2.8"]]' -- \ | |
update-in : dissoc :aliases -- \ | |
with-profile -run \ | |
run -m liquibase.integration.commandline.Main \ | |
--changeLogFile=resources/migrations/000_migrations.yaml \ | |
--url='jdbc:postgresql://localhost:5432/metabase?user=cam&password=cam' \ | |
dbDoc target/liquibase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmigration ^{:added "0.39.0"} migrate-map-regions | |
(reduce | |
(fn [_ {card-id :id, {map-region :map.region, :as viz-settings} :visualization_settings}] | |
(when (= map-region "us_states") | |
(let [new-settings (update viz-settings :map.region str/upper-case)] | |
(db/update! Card card-id :visualization_settings new-settings)))) | |
nil | |
(db/select-reducible [Card :id :visualization_settings]))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns metabase.driver.mbql | |
(:require [cheshire.core :as json] | |
[metabase.driver :as driver] | |
[metabase.driver.sql-jdbc.connection :as sql-jdbc.conn] | |
[metabase.mbql.normalize :as normalize] | |
[metabase.models :refer [Database]] | |
[metabase.query-processor :as qp] | |
[metabase.query-processor.store :as qp.store] | |
[toucan.db :as db])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun cam/-next-sexp-on-current-line-p () | |
"Whether the next sexp after point is one the current line." | |
(let ((next-sexp (save-excursion | |
(paredit-forward) | |
(current-line)))) | |
(= next-sexp (current-line)))) | |
(defun cam/-clojure-in-expect-form-p () | |
"Whether we are currently in a expect form." | |
(save-excursion |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2021-04-16 14:25:10,346 DEBUG middleware.log :: GET /api/card/8717 200 8.8 ms (5 DB calls) App DB connections: 5/15 Jetty threads: 41/50 (6 idle, 0 queued) (96 total active threads) Queries in flight: 0 (0 queued) | |
2021-04-16 14:25:10,347 DEBUG middleware.log :: GET /api/card/8717 200 8.3 ms (5 DB calls) App DB connections: 9/15 Jetty threads: 41/50 (6 idle, 0 queued) (96 total active threads) Queries in flight: 0 (0 queued) | |
2021-04-16 14:25:10,347 DEBUG middleware.log :: GET /api/card/8717 200 8.6 ms (5 DB calls) App DB connections: 9/15 Jetty threads: 41/50 (6 idle, 0 queued) (96 total active threads) Queries in flight: 0 (0 queued) | |
2021-04-16 14:25:10,347 DEBUG middleware.log :: GET /api/card/8717 200 9.9 ms (5 DB calls) App DB connections: 4/15 Jetty threads: 41/50 (6 idle, 0 queued) (96 total active threads) Queries in flight: 0 (0 queued) | |
2021-04-16 14:25:10,347 DEBUG middleware.log :: GET /api/card/8717 200 9.0 ms (5 DB calls) App DB connections: 3/15 Jetty threads: 41/50 (6 idle, 0 queued) (96 total ac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- updated.old.json 2021-04-30 15:50:09.720000000 -0700 | |
+++ updated.json 2021-04-30 15:59:20.510000000 -0700 | |
@@ -14,6 +14,7 @@ | |
"1.14.0-0": "zip+https://cdn.azul.com/zulu/bin/zulu14.27.1-ca-jdk14-win_x64.zip", | |
"1.14.0": "zip+https://cdn.azul.com/zulu/bin/zulu14.29.23-ca-jdk14.0.2-win_x64.zip", | |
"1.13.0-6": "zip+https://cdn.azul.com/zulu/bin/zulu13.37.21-ca-jdk13.0.6-win_x64.zip", | |
+ "1.13.0-5.1": "zip+https://cdn.azul.com/zulu/bin/zulu13.35.51-ca-jdk13.0.5.1-win_x64.zip", | |
"1.13.0-5": "zip+https://cdn.azul.com/zulu/bin/zulu13.35.17-ca-jdk13.0.5-win_x64.zip", | |
"1.13.0-4": "zip+https://cdn.azul.com/zulu/bin/zulu13.33.25-ca-jdk13.0.4-win_x64.zip", | |
"1.13.0-3": "zip+https://cdn.azul.com/zulu/bin/zulu13.31.11-ca-jdk13.0.3-win_x64.zip", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn unsorted [password] | |
(let [lines (atom 0)] | |
(with-open [reader (java.io.BufferedReader. (java.io.FileReader. (io/file (io/resource "common_passwords.txt"))))] | |
{:bad? (boolean | |
(some | |
(fn [a-password] | |
(swap! lines inc) | |
(= a-password password)) | |
(iterator-seq (.. reader lines iterator)))) | |
:n @lines}))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmulti my-multimethod | |
keyword) | |
(derive ::x ::keyword) | |
(derive ::y ::keyword) | |
(defmethod my-multimethod ::x | |
[_] | |
::x) |