Skip to content

Instantly share code, notes, and snippets.

View damienstanton's full-sized avatar
🤷

Damien Stanton damienstanton

🤷
  • PwC
  • DC & Baltimore, USA
  • 03:27 (UTC -04:00)
View GitHub Profile
(ns datascript-to-datomic-util
(:require [datascript :as d]))
;;;; a utility to help with a datomic-datascript roundtrip process involving:
;;; 1. export some data from a datomic database and transact into a datascript instance.
;;; 2. perform one or more transactions against datascript.
;;; 3. transact the sum of all changes made against datascript back into datomic in a single tx
;;; this namespace contains two public functions:
;;; listen-for-changes: listen to datascript transactions and build up a record of changes
(function () {
var React = require('react'),
injectTapEventPlugin = require("react-tap-event-plugin"),
materialUI = require('material-ui');
//Needed for React Developer Tools
window.React = React;
window.MaterialUI = materialUI;
@damienstanton
damienstanton / reagent_datascript.cljs
Last active June 22, 2016 13:46 — forked from allgress/reagent_datascript.cljs
Test use of DataScript for state management of Reagent views.
(ns reagent-test.core
(:require [reagent.core :as reagent :refer [atom]]
[datascript.core :as d]
[cljs-uuid-utils :as uuid]))
(enable-console-print!)
(defn bind
([conn q]
(bind conn q (atom nil)))
@damienstanton
damienstanton / thoughts.md
Created February 9, 2022 20:58 — forked from tazjin/thoughts.md
Nix builder for Kubernetes
@damienstanton
damienstanton / virtual_threads.clj
Created June 20, 2023 12:38 — forked from mikeananev/virtual_threads.clj
Java 19 virtual threads and Clojure
(ns user
(:import (java.util.concurrent Executors)))
;; Thread factory for virtual threads
(defn thread-factory [name]
(-> (Thread/ofVirtual)
(.name name 0)
(.factory)))
;; Define an executor which just produce a new virtual thread for every task