Skip to content

Instantly share code, notes, and snippets.

View escherize's full-sized avatar

bryan escherize

View GitHub Profile
(ns cycloj.core
(:require [clojure.walk :as walk]
[clojure.repl :as repl]
[clojure.edn :as edn]
[clojure.string :as str]))
(defn r-rresolve [s]
(try (resolve s)
(catch Exception e (try (requiring-resolve s)
(catch Exception e nil)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Execution requires a set of operations, a starting state, and a script.
;;
;; Each operation from the script is applied to the state, and returns a map where the keys are effects (fxs), and the values are the single args to the fx handlers.
;; the state is updated by the :value fx handle. Also, each operation's result is added to the output.
;; (record!)
(defn check-sample [sample]
(let [{:keys [api-perms data-perms]} sample]
[[::data-perms (fmt data-perms)]
[::data->api (fmt (:groups (data-perms.graph/db-graph->api-graph data-perms)))]
[::api (fmt (:groups api-perms))]
[::equal? (= (:groups (data-perms.graph/db-graph->api-graph data-perms))
(:groups api-perms))]]))
(mapv check-sample (samples))
(ns dev.nocommit.massive-perm-graph
(:require [clojure.string :as str]
[criterium.core :as criterium]
[metabase.models.permissions :as perms]
[metabase.models.permissions-group :as perms-group]
[metabase.test :as mt]
[metabase.util.log :as log]
[toucan2.core :as t2]))
(comment
(ns dev.nocommit.massive-perm-graph
(:require [metabase.test :as mt]
[criterium.core :as criterium]
[metabase.util :as u]))
(comment
(defn get-graph [] (mt/user-http-request :crowberto :get 200 "permissions/graph"))
javascript:(function(){ if (window.whiteboardActive) { var existingTpdiv = document.getElementById('transparentWhiteboardDiv'); if (existingTpdiv) {existingTpdiv.remove();} var existingCanvas = document.getElementById('transparentWhiteboardCanvas'); if (existingCanvas) { existingCanvas.remove();} window.whiteboardActive = false; return; } var tpdiv = document.createElement('div'); tpdiv.id = 'transparentWhiteboardDiv'; tpdiv.style.position = 'fixed'; tpdiv.style.top = '0'; tpdiv.style.left = '0'; tpdiv.style.width = '100%'; tpdiv.style.height = '100%'; tpdiv.style.zIndex = '999999'; tpdiv.style.pointerEvents = 'none'; tpdiv.style.background = 'rgba(255, 231, 210, 0.4)'; document.body.appendChild(tpdiv); var canvas = document.createElement('canvas'); canvas.style.position = 'fixed'; canvas.style.top = '0'; canvas.style.left = '0'; canvas.width = window.innerWidth; canvas.height
#!/usr/bin/env bb
(ns emoji-hash
(:require [babashka.deps :as deps]
[babashka.http-client :as http]
[cheshire.core :as json]
[clj-yaml.core :as yaml]
[clojure.data.xml :as xml]
[clojure.edn :as edn]
[selmer.parser :refer [<<]]
(ns emoji-hash
(:require
;; n.b. these can be used inside of mods.edn!
[babashka.http-client :as http]
;; [babashka.deps :as deps]
[babashka.pods :as pods]
[babashka.process :refer [process check sh pipeline pb]]
[babashka.fs :as fs]
[babashka.tasks :refer [shell]]
[cheshire.core :as json]
➜  janet-playground bat jam.janet
────┬────────────────────────────────────────
    │ File: jam.janet
────┼────────────────────────────────────────
  1 │ (use judge)
  2 │
  3 │ # Testing values
  4 │
  5 │ (defn double [x] (* x x))
;;; init.el -*- lexical-binding: t; -*-
;; This file controls what Doom modules are enabled and what order they load
;; in. Remember to run 'doom sync' after modifying it!
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
;; documentation. There you'll find a "Module Index" link where you'll find
;; a comprehensive list of Doom's modules and what flags they support.
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or