This file contains hidden or 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
;; Please have a look https://github.com/ertugrulcetin/jme-clj for more. | |
;; Demo video used this gist: https://www.youtube.com/watch?v=IOPz9I49snM | |
(ns examples.beginner-tutorials.hello-collision | |
"Clojure version of https://wiki.jmonkeyengine.org/docs/3.3/tutorials/beginner/hello_collision.html" | |
(:require [jme-clj.core :refer :all]) | |
(:import | |
(com.jme3.asset.plugins ZipLocator) | |
(com.jme3.input KeyInput) | |
(com.jme3.math ColorRGBA))) |
This file contains hidden or 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
;; Please have a look https://github.com/ertugrulcetin/jme-clj for more. | |
;; Demo video used this gist: https://www.youtube.com/watch?v=IOPz9I49snM | |
(ns examples.beginner-tutorials.hello-physics | |
"Clojure version of https://wiki.jmonkeyengine.org/docs/3.3/tutorials/beginner/hello_physics.html" | |
(:require [jme-clj.core :refer :all]) | |
(:import | |
(com.jme3.input MouseInput) | |
(com.jme3.math Vector3f) | |
(com.jme3.scene.shape Sphere$TextureMode) | |
(com.jme3.texture Texture$WrapMode))) |
This file contains hidden or 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 jm-clj.core | |
(:import (com.jme3.app SimpleApplication) | |
(com.jme3.scene.shape Box) | |
(com.jme3.scene Geometry) | |
(com.jme3.material Material) | |
(com.jme3.math ColorRGBA))) | |
(defn my-logic [^SimpleApplication this] | |
(let [b (Box. 1 1 1) | |
geom (Geometry. "Box" b) |
This file contains hidden or 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 jm-clj.core | |
(:import (com.jme3.app SimpleApplication) | |
(com.jme3.scene.shape Box) | |
(com.jme3.scene Geometry) | |
(com.jme3.material Material) | |
(com.jme3.math ColorRGBA))) | |
;(def ^:dynamic *app-settings* (doto (AppSettings. true) | |
; (.setFullscreen false) | |
; (.setTitle "jme_clj"))) |
This file contains hidden or 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
(defmacro component | |
([name tag] | |
`(component ~name ~tag nil)) | |
([name tag docs] | |
(if docs | |
`(defmacro ~(with-meta name {:tag tag}) ~docs | |
[object# k# & options#] | |
`(u/call! ~object# ~k# ~@options#)) | |
`(defmacro ~(with-meta name {:tag tag}) | |
[object# k# & options#] |
This file contains hidden or 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
(defn update-xmind | |
"Manipulates Xmind data and saves as a binary format. Usage: | |
This example updates all \"Report\" titles with \"HEY!\" | |
(update-xmind \"~/xmind-files/report.xmind\" | |
\"~/xmind-files/report-new.xmind\" | |
(fn [data] | |
(o/transform data | |
(o/and | |
(d/query data ?path :title ?title) |
This file contains hidden or 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
(require '[clojure.core.logic :refer [== run fresh]] | |
'[clojure.walk :as walk]) | |
(defn function-call->form [form] | |
(walk/prewalk (fn [node] | |
(cond | |
(and (list? node) | |
(or (-> node first resolve nil?) | |
(-> node first resolve meta :special-form) | |
(-> node first resolve meta :macro))) |
This file contains hidden or 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
(defn wrap-some-data | |
[handler] | |
(fn [request] | |
(let [updated-request (assoc request :site-owner "Ertuğrul")] | |
;; ▼▼▼ returns response ▼▼▼ | |
(handler updated-request)))) | |
;; :resource-ns-path -> src/clj_web_app dizini altındaki namespace'leri tarar ve tüm `resource`'ları bulup döndürür | |
(def app-routes (get-routes {:resource-ns-path "clj-web-app." |
This file contains hidden or 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
(:require [patika.core :refer [resource get-routes]] | |
[ring.adapter.jetty :refer [run-jetty]] | |
;; Middlewares | |
[ring.middleware.reload :refer [wrap-reload]] | |
[ring.middleware.cookies :refer [wrap-cookies]] | |
[ring.middleware.gzip :refer [wrap-gzip]] | |
[compojure.core :as c] | |
[compojure.route :as r]) |
This file contains hidden or 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 clj-web-app.core | |
(:require [patika.core :refer [resource get-routes]] | |
[ring.adapter.jetty :refer [run-jetty]] | |
[compojure.core :as c] | |
[compojure.route :as r])) | |
(resource home | |
:get ["/"] | |
:content-type :html | |
:handle-ok (fn [ctx] "<html> |