These notes are based upon the steps provided here:
The notes in this Gist were created due to multiple attempts at installing Open Genera on different platforms that required more steps not inlcuded in the source notes above.
These notes are based upon the steps provided here:
The notes in this Gist were created due to multiple attempts at installing Open Genera on different platforms that required more steps not inlcuded in the source notes above.
Using JavaScript libraries from ClojureScript involves two distinct concerns:
Right now, the only single tool that solves these probems reliably, optimally, and with minimal configuration is shadow-cljs
, and so that is what I favor. In paricular, shadow-cljs
lets you install npm modules using npm
or yarn
and uses the resulting package.json
to bundle external dependencies. Below I describe why, what alternatives there are, and what solutions I disfavor at this time.
(ns cljsjs.jwt | |
(:require | |
[clojure.spec :as s] | |
[clojure.string :as str] | |
[goog.json :as json] | |
[goog.crypt.base64 :refer [encodeString decodeString]])) | |
;; https://github.com/Caligatio/jsSHA | |
;; goog.crypt.hmac produces different signature than nodejs version | |
(def jssha (js/require "jssha")) |
(set-env! :dependencies '[[leiningen-core "2.5.0"]]) | |
(use 'leiningen.core.project) | |
(eval (read-string (slurp "project.clj"))) | |
(set-env! | |
:source-paths (:source-paths project) | |
:resource-paths (:resource-paths project) | |
:dependencies (:dependencies project)) | |
My efforts to port http://www.youtube.com/watch?v=f6kdp27TYZs to Clojure.
func boring(msg string) {
for i := 0; ; i++ {
fmt.Println(msg, i)
time.Sleep(time.Second)
}
(ns n01se.externs-for-cljs | |
(:require [clojure.java.io :as io] | |
[cljs.compiler :as comp] | |
[cljs.analyzer :as ana])) | |
(defn read-file [file] | |
(let [eof (Object.)] | |
(with-open [stream (clojure.lang.LineNumberingPushbackReader. (io/reader file))] | |
(vec (take-while #(not= % eof) | |
(repeatedly #(read stream false eof))))))) |
;; from leiningen, use [dorothy/dorothy "0.0.3"] | |
(require '[dorothy.core :as dot]) | |
;; dataflow copied from chat | |
;; https://github.com/pedestal/samples/blob/master/chat/chat-client/app/src/chat_client/behavior.clj | |
(def dataflow '{:transform | |
{:outbound {:init {} :fn outbound-transform} | |
:inbound {:init {} :fn inbound-transform} | |
:nickname {:init nil :fn nickname-transform}} | |
:effect {:outbound send-message-to-server} |
(ns scottdw.image | |
(:import | |
[java.awt Color Image Dimension] | |
[java.awt.image BufferedImage] | |
[java.io File] | |
[javax.imageio ImageIO] | |
[javax.swing JFrame JPanel]) | |
(require [scottdw.stats :as stats])) | |
(defn read-image [^String filename] |