Let’s first write a function to check the outputs. Since it’s quite simple, I’ll use the example from the problem definition and a couple of corner cases:
(defn spy [x] (prn x) x)
export const useCancelTask = (taskUUID: string) => { | |
const queryClient = useQueryClient(); | |
return useMutation( | |
() => ( | |
api.cancelTask(taskUUID).then(res => res.data) | |
), { | |
onSuccess: data => defaultOnSuccess(queryClient, data), | |
mutationKey: ["tasks", "cancel", {uuid: taskUUID}], | |
} | |
); |
(defun helm-eglot--build-code-actions-source (menu-items) | |
(let* ((execute-selected-action (lambda (action) (eglot--code-actions-execute-action (cdr (assoc action menu-items)))))) | |
(helm-build-sync-source "Eglot Code actions" | |
:candidates | |
(lambda () (mapcar #'car menu-items)) | |
:action `(("Execute action" . ,execute-selected-action))))) | |
(defun helm-eglot-code-actions (beg &optional end action-kind) | |
"Offer to execute code actions between BEG and END using helm. | |
Interactively, if a region is active, BEG and END are its bounds, |
{"spectrum": {"show": "true", "n-points": "100", "height": "100", "use-custom-color": "false", "fill": "true", "show-bar-border": "true", "scale": "1", "exponent": "1", "sampling-freq": "10", "line-width": "2", "type": "Bars", "color": ["1", "1", "1", "1"], "gradient-color": ["0", "0", "0", "1"]}, "output": {"blacklist": "", "plugins_order": ["limiter", "autogain", "gate", "multiband_gate", "compressor", "multiband_compressor", "convolver", "bass_enhancer", "exciter", "crystalizer", "stereo_tools", "reverb", "equalizer", "delay", "deesser", "crossfeed", "loudness", "maximizer", "filter", "pitch"], "bass_enhancer": {"state": "false", "input-gain": "0", "output-gain": "0", "amount": "0", "harmonics": "8.5", "scope": "100", "floor": "20", "blend": "0", "floor-active": "false", "listen": "false"}, "compressor": {"state": "false", "input-gain": "0", "output-gain": "0", "mode": "Downward", "attack": "20", "release": "100", "threshold": "-12", "ratio": "4", "knee": "-6", "makeup": "0", "sidechain": {"listen": "false |
(load-extension "libfive-guile" "scm_init_libfive_modules") | |
(use-modules (libfive kernel) (libfive vec) (libfive csg) (libfive shapes) (libfive transforms)) | |
(define test-shape | |
(difference | |
(sphere 1 #[0 0 0]) | |
(cylinder-z 0.6 2 #[0 0 -1]) | |
(reflect-xz (cylinder-z 0.6 2 #[0 0 -1])) | |
(reflect-yz (cylinder-z 0.6 2 #[0 0 -1])))) | |
(shape->mesh test-shape "out.stl" 10 '((-2 . 2) (-2 . 2) (-2 . 2))) |
(ns common.config | |
(:require [aero.alpha.core :as aero.alpha] | |
[aero.core :as aero] | |
[clojure.java.io :as io] | |
[buddy.core.keys :as buddy.keys])) | |
(defn- rewrap [tl] | |
(fn [v] (tagged-literal (:tag tl) v))) | |
(defmethod aero.alpha/eval-tagged-literal 'priv-key |
(ns leak-test.core | |
(:gen-class)) | |
(def alphanumerics (concat (map char (range (int \A) (inc (int \Z)))) | |
(range 0 10))) | |
(defn random-alphanumeric-string [len] | |
"Generates a pseudo-random alphanumeric string" | |
(apply str (repeatedly len #(rand-nth alphanumerics)))) |
(ns playground | |
(:require [state-flow.core :as state-flow] | |
[state-flow.state :as state])) | |
(defn inc-a [s] | |
(update s :a inc)) | |
(defn change-state [] | |
(state/modify inc-a)) |
(ns caioaao.purely-functional.solutions.range-consolidation) | |
(defn ranges->events [vs] | |
(mapcat (fn [[a b]] [[:open a] [:close b]]) vs)) | |
(def type->priority | |
{:open 1 | |
:close 2}) | |
;; since range includes both ends, `open` events have priority over `close` |
(ns aeron-cluster-test.core | |
(:require [clojure.stacktrace :refer [print-stack-trace]]) | |
(:import [org.agrona CloseHelper] | |
[org.agrona.concurrent AgentTerminationException] | |
[org.agrona ExpandableArrayBuffer] | |
[org.agrona ErrorHandler] | |
[io.aeron.cluster ClusteredMediaDriver ConsensusModule ConsensusModule$Context] | |
[io.aeron.cluster.client EgressListener AeronCluster AeronCluster$Context ] | |
[io.aeron.cluster.service ClusteredService ClusteredServiceContainer ClusteredServiceContainer$Context Cluster ClusteredServiceAgent ClientSession] |