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 metosin.common.edn | |
#+clj | |
(:require [clj-time.format :as f]) | |
#+cljs | |
(:require [cljs-time.format :as f] | |
cljs.reader) | |
#+clj (:import [org.joda.time DateTime LocalDate])) | |
;; | |
;; #DateTime tagging |
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
Verifying that "nha.id" is my Blockstack ID. https://onename.com/nha |
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
;; Converts Bootstrap HTML into ClojureScript Om code | |
;; Formats output as well | |
;; Useful when you want to mock a Bootstrap layout but then convert to ClojureScript Om code. | |
(ns com.seltzer1717.term.server.parsehtml | |
(:import | |
(java.io | |
FileReader | |
FileWriter | |
BufferedReader | |
BufferedWriter) |
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
;; Converts Bootstrap HTML into ClojureScript Om code | |
;; Formats output as well | |
;; Useful when you want to mock a Bootstrap layout but then convert to ClojureScript Om code. | |
(ns com.seltzer1717.term.server.parsehtml | |
(:import | |
(java.io | |
FileReader | |
FileWriter | |
BufferedReader | |
BufferedWriter) |
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 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))))))) |
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 carder-devcards.map | |
(:require [taoensso.timbre :as timbre] | |
[cljsjs.react-leaflet] ;; js/ReactLeaflet | |
) | |
(:require-macros [devcards.core :as dc :refer [defcard defcard-doc defcard-om-next noframe-doc deftest dom-node]])) | |
(defn build | |
([component props] | |
(build component props (array))) |
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
(function(context) { | |
'use strict'; | |
var Timer = Java.type('java.util.Timer'); | |
var Phaser = Java.type('java.util.concurrent.Phaser'); | |
var TimeUnit = Java.type('java.util.concurrent.TimeUnit'); | |
var AsyncHttpClient = Java.type('com.ning.http.client.AsyncHttpClient'); | |
var timer = new Timer('jsEventLoop', false); | |
var phaser = new Phaser(); |
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
;; MUST be possible | |
;; http://funcool.github.io/cats/latest/#alet | |
;; https://gist.github.com/aclemmensen/11272381 | |
;; http://www.lispcast.com/core-async-browser-motivation | |
;; https://gist.github.com/aclemmensen/11272381 | |
(defn sample-async-fn [t s] | |
(println "sample-async-fn" t s js/Date.) | |
(go (<! (timeout t)) |
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
;; (require '[clojure.string :as str] '[clojure.java.shell :as shell] '[taoensso.timbre :as timbre]) | |
(defn with-free-port! | |
"Attempts to kill any current port-binding process, then repeatedly executes | |
nullary `bind-port!-fn` (which must return logical true on successful | |
binding). Returns the function's result when successful, else throws an | |
exception. *nix only. | |
This idea courtesy of Feng Shen, Ref. http://goo.gl/kEolu." | |
[port bind-port!-fn & {:keys [max-attempts sleep-ms] |
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 datascript-utils | |
(:require [datascript :as d])) | |
(defn data->datoms [prefix json] | |
(let [make-prefix | |
(fn [p] | |
(let [[full short] | |
(re-matches #"(.+?)s?$" p)] | |
short))] |