Skip to content

Instantly share code, notes, and snippets.

View caioaao's full-sized avatar
🏠
Working from home

Caio Augusto Araújo Oliveira caioaao

🏠
Working from home
View GitHub Profile
@caioaao
caioaao / common_config.clj
Last active February 14, 2020 15:57
buddy keys aero tagged literals
(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
(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)))
@caioaao
caioaao / Audio-Technica ATH-M40x ParametricEQ.json
Created January 29, 2021 13:08
PulseEffects presets for ATH-M40X, as described here: https://github.com/jaakkopasanen/AutoEq
{"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
@caioaao
caioaao / helm-eglot-code-actions.el
Created February 17, 2021 13:01
Example snippet using Eglot code-actions with Helm
(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,
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}],
}
);