This file contains 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 example.edn-validator | |
(:require [clojure.string :as str] | |
[clojure.pprint :refer [pprint]] | |
[miracle.save :refer-macros [save]])) | |
;; Cases: | |
;; lists: {} () [] | |
;; strings: "" | |
;; comments: ;; \n (doesn't have to be closed) | |
;; escape: \ (ignores next) |
This file contains 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 example.edn-validator) | |
;; Validator to be used when getting edn-data from a stream | |
;; if you straigt up run `edn/parse` you get exceptions on | |
;; data that isn't well formed. | |
;; Validate tries to parse whatever data you've got right now | |
;; and provides information about wether the data is well formed | |
;; or not. Check the bottom for example code. |
This file contains 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 game.other-init | |
(:require [arcadia.core :refer :all] | |
[arcadia.linear :as l] | |
[arcadia.introspection :as i]) | |
(:import | |
[UnityEngine Application | |
QualitySettings])) | |
;; Don't burn my computer | |
(defn init-fps! |
This file contains 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 miracle.catcher | |
(:require [clojure.walk :as w] | |
[clojure.test :as t])) | |
(defn unwrap | |
"Traverses a body using `f` (e.g. `map`), and removes calls to `try-body`." | |
[f body] | |
(f | |
#(if (and (coll? %) | |
(= (first %) 'miracle.catcher/try-body)) |
This file contains 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 spec-gen.core | |
(:require [clojure.spec.alpha :as s] | |
[clojure.string :as str] | |
[clojure.java.io :as io]) | |
(:gen-class)) | |
(def atom-specs | |
[(s/def ::number number?) | |
(s/def ::string string?) | |
(s/def ::keyword keyword?) |
This file contains 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
;; 1. Create an empty game object called "Beholder" | |
;; 2. Create a cube and add it as a child to the Beholder | |
;; 3. Run `(dehydrate-all!)` | |
;; 4. Move the created cube, then rotate it | |
;; 5. Run `(hydrate-all!)` | |
;; 6. Boom | |
(ns game.hydration | |
(:require [arcadia.core :refer :all] | |
[clojure.string :as str] |
This file contains 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 miracle.tools.save | |
(:require [clojure.walk :refer [postwalk]])) | |
(def ^:dynamic *max-saves* 50) | |
(defn gensym? [s] | |
(re-find #"__\d+" s)) | |
(defn fn->var | |
"Takes a function and returns a var. Works even on function objects." |
This file contains 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
Plugin 'clojure.genclass.clj.dll' is used from several locations: | |
Assets/Arcadia/Infrastructure/clojure.genclass.clj.dll would be copied to <PluginPath>/clojure.genclass.clj.dll | |
Assets/Arcadia/Export/clojure.genclass.clj.dll would be copied to <PluginPath>/clojure.genclass.clj.dll | |
Plugin 'clojure.uuid.clj.dll' is used from several locations: | |
Assets/Arcadia/Export/clojure.uuid.clj.dll would be copied to <PluginPath>/clojure.uuid.clj.dll | |
Assets/Arcadia/Infrastructure/clojure.uuid.clj.dll would be copied to <PluginPath>/clojure.uuid.clj.dll | |
Plugin 'clojure.core.clj.dll' is used from several locations: | |
Assets/Arcadia/Infrastructure/clojure.core.clj.dll would be copied to <PluginPath>/clojure.core.clj.dll | |
Assets/Arcadia/Export/clojure.core.clj.dll would be copied to <PluginPath>/clojure.core.clj.dll | |
Plugin 'clojure.core_deftype.clj.dll' is used from several locations: |
This file contains 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
;;;; | |
;; profiling.clj -- simple profiling macros for Clojure CLR | |
;; by Jona Ekenberg, https://github.com/saikyun | |
;; February 6th, 2019 | |
;; Copyright (c) Jona Ekenberg, 2019. All rights reserved. The use | |
;; and distribution terms for this software are covered by the Eclipse | |
;; Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) | |
;; which can be found in the file epl-v10.html at the root of this |
This file contains 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
;; Need to (:import System.Diagnostics.Stopwatch) | |
(defonce times (atom {})) | |
(defn reset-times! [] (reset! times {})) | |
(defn avg [vs] (/ (reduce + vs) (count vs))) | |
(defn avgs [] (into {} (map (fn [ [k vs] ] [k {:total (reduce + vs) :calls (count vs) :max (apply max vs) :min (apply min vs) :avg (avg vs)}]) @times))) | |
(defn avgs-hm [] (into (sorted-map) (map (fn [[k vs]] [(:total vs) (assoc vs :name k)]) (filter (fn [[k vs]] (or (< 10 (:total vs)) (and (< 10 (:calls vs)) (< 0.1 (:avg vs))))) (avgs))))) |