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
docker system prune -a |
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
(defmacro logged-binding {:style/indent 1} [[symb val] & body] | |
`(do | |
(let [val# ~val] | |
(println | |
(colorize.core/magenta | |
(format ~(format "[%s:%d] BOUND %s -> %%s" (ns-name *ns*) (:line (meta &form)) (str symb)) val#))) | |
(let [result# (binding [~symb val#] | |
~@body)] | |
(println | |
(colorize.core/red |
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
{:dependencies | |
{metabase.query-processor | |
#{metabase.query-processor.middleware.expand-macros metabase.query-processor.middleware.bind-effective-timezone metabase.query-processor.middleware.resolve-joins | |
metabase.query-processor.middleware.driver-specific metabase.query-processor.middleware.catch-exceptions metabase.query-processor.middleware.splice-params-in-response schema.core | |
metabase.query-processor.middleware.async metabase.query-processor.middleware.format-rows metabase.query-processor.middleware.add-row-count-and-status | |
metabase.query-processor.middleware.add-implicit-joins metabase.query-processor.middleware.resolve-fields metabase.query-processor.middleware.normalize-query | |
metabase.query-processor.middleware.validate metabase.driver metabase.query-processor.middleware.resolve-source-table metabase.query-processor.middleware.annotate | |
metabase.query-processor.middleware.process-userland-query metabase.query-processor.middleware.reconcile-breakout-and-order-by-bucketing metabase.q |
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- normalize-details [details] | |
(let [{:keys [dbname host port user pass ssl authdb tunnel-host tunnel-user tunnel-pass additional-options] | |
:or {port 27017, pass "", ssl false}} details | |
;; ignore empty :user and :pass strings | |
user (when (seq user) | |
user) | |
pass (when (seq pass) | |
pass) | |
authdb (if (seq authdb) | |
authdb |
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
(def Apple | |
{::type (s/eq :apple) | |
:color (s/enum :red :yellow :green)}) | |
(def Orange | |
{::type (s/eq :orange) | |
:color (s/eq :orange)}) | |
(def Fruit | |
(s/conditional |
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
#! /usr/bin/env bash | |
sudo gem install terminal-notifier | |
terminal-notifier \ | |
-message "WOW" \ | |
-title "Title" \ | |
-contentImage http://www.brittonbunch.com/WondersOfCreation/images/tucan.gif |
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- x [] | |
(mt/with-driver :redshift | |
(count (mt/rows (mt/run-mbql-query :venues))) | |
(print \.) | |
(flush))) | |
(defn- datasource ^javax.sql.DataSource [] | |
(:datasource (sql-jdbc.conn/db->pooled-connection-spec (mt/with-driver :redshift (mt/db))))) | |
(defn- print-results [^java.sql.ResultSet rs] |
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- all-threads [] | |
(transduce | |
identity | |
(fn | |
([] | |
{}) | |
([m] | |
(into (flatland.ordered.map/ordered-map) | |
(cons |
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
;;; -*- lexical-binding: t; coding: utf-8; -*- | |
(defun cam/-scroll-percentage () | |
(/ (float (line-number-at-pos (window-start))) | |
(float (line-number-at-pos (point-max))))) | |
(defun cam/-set-window-start-to-percentage (scroll-percentage) | |
(goto-char (point-min)) | |
(let ((target-line-number (truncate (* (line-number-at-pos (point-max)) scroll-percentage)))) | |
(forward-line (1- target-line-number))) |
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 all-ex-data | |
"Combined `ex-data` from all instances of `ExceptionInfo`. Prefers keys from lower-level Exceptions (e.g. the root | |
cause)." | |
[e] | |
(->> (iterate ex-cause e) | |
(take-while some?) | |
(map ex-data) | |
(reduce merge))) | |
(defn- catch-form? [x] |