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
(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 make-change | |
(:refer-clojure :exclude [==]) | |
(:require [clojure.core.logic :refer :all] | |
[clojure.core.logic.fd :as fd])) | |
(def common-us-coins | |
{: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
;;; -*- lexical-binding: t; -*- | |
(defun cam/clean-file (file &optional callback) | |
(save-current-buffer | |
(find-file file) | |
(save-buffer) | |
(condition-case err | |
(cider-load-buffer | |
(current-buffer) | |
(cider-load-file-handler |
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
(cl-defun cam/visible-buffer-matching (pred &optional return-multiple-values?) | |
"Return the first buffer visible in any window on any frame that satisfies PRED." | |
(dolist (frame (frame-list)) | |
(dolist (window (window-list frame)) | |
(let ((buffer (window-buffer window))) | |
(when (funcall pred buffer) | |
(cl-return-from cam/visible-buffer-matching (if return-multiple-values? | |
(list buffer window frame) | |
buffer))))))) |
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.query-processor.multiple | |
(:require [clojure.core.async :as a] | |
[metabase.query-processor :as qp] | |
[metabase.query-processor.context :as qp.context] | |
[metabase.query-processor.context.default :as context.default])) | |
(defn- process-query-append-results | |
"Reduce the results of a single `query` using `rf` and initial value `init`." | |
[query rf init context] | |
(if (a/poll! (qp.context/canceled-chan context)) |
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
FROM alpine:edge | |
MAINTAINER Cam Saul <[email protected]> | |
WORKDIR /app | |
RUN apk add --update curl sbcl | |
# create a unpriviledged user | |
RUN addgroup -S lisp |
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
clojure -X:deps tree |
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
(doseq [[setting-name {:keys [visibility sensitive?]}] (sort-by first @registered-settings)] | |
(println (str (format "%s (visibility: %s)" setting-name (name visibility)) (when sensitive? " (sensitive)")))) | |
abandonment-email-sent (visibility: internal) | |
admin-email (visibility: authenticated) | |
anon-tracking-enabled (visibility: public) | |
api-key (visibility: internal) | |
application-colors (visibility: public) | |
application-favicon-url (visibility: public) | |
application-logo-url (visibility: public) |
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
! Use these commands to determine original values: | |
! | |
! xmodmap -pke | |
! xmodmap -pm | |
! original values | |
! | |
! keycode 37 = Control_L NoSymbol Control_L | |
! keycode 64 = Alt_L Meta_L Alt_L Meta_L | |
! keycode 109 = Control_R NoSymbol Control_R |