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
TorqueBox::Web::Server.sockjs('/messages').on_connection do |conn| | |
TorqueBox::Messaging::Topic.new('browser-messages').listen do |m| | |
conn.write(m) | |
end | |
end |
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 logerror.core | |
(:require | |
[immutant.cache :as cache] | |
[clojure.tools.logging :as log])) | |
(println @#'clojure.tools.logging/*logger-factory*) | |
(try | |
(def my-cache (cache/create "cache")) | |
(catch Exception e | |
(.printStackTrace e) |
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 'compile) | |
(defun locate-all-dominating-files (dir filename) | |
"Searches for FILENAME in DIR and its parents, returning a list | |
of all dirs containing the file." | |
(let ((found-dir (locate-dominating-file (expand-file-name dir) filename))) | |
(if found-dir | |
(cons found-dir (locate-all-dominating-files | |
(concat found-dir "..") | |
filename))))) |
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.http.client | |
(:require [vertx.http :as http] | |
[vertx.stream :as stream])) | |
(-> (http/client {:port 8080 :host "localhost"}) | |
(http/get-now "/" | |
(fn [response] | |
(-> response | |
(stream/on-data | |
(fn [buffer] |
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
(define-key erc-mode-map (kbd "C-c m") | |
(lambda (nick) | |
(interactive (list (completing-read "Say 'morning!' to nick: " erc-channel-users))) | |
(erc-send-message (format "%s: morning!" nick)))) |
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
Server Port: 8097 | |
Requests per second: 50152.41 [#/sec] (mean) | |
Server Port: 8097 | |
Requests per second: 50727.22 [#/sec] (mean) | |
Server Port: 8097 | |
Requests per second: 50621.04 [#/sec] (mean) | |
Server Port: 8097 | |
Requests per second: 50338.69 [#/sec] (mean) | |
=============================================== |
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
(add-hook 'clojure-mode-hook 'tc/run-common-coding-hooks) | |
(add-hook 'clojure-mode-hook 'tc/run-lisp-coding-hooks) | |
(add-to-list 'auto-mode-alist '("\\.dtm$" . clojure-mode)) | |
(add-to-list 'auto-mode-alist '("\\.edn$" . clojure-mode)) | |
(add-to-list 'auto-mode-alist '("\\.cljs$" . clojure-mode)) | |
(setq clojure-defun-style-default-indent t) | |
(setq nrepl-popup-stacktraces nil) |
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
(defn ^:internal ^:no-doc delayed | |
"Creates an timeout-derefable delay around any function taking a timeout" | |
[f] | |
(let [val (atom ::unrealized) | |
realized? #(not= ::unrealized @val) | |
rcv (fn [timeout] (reset! val (f timeout)))] | |
(proxy [clojure.lang.Delay clojure.lang.IBlockingDeref] [nil] | |
(deref | |
([] | |
(if (realized?) @val (rcv 0))) |
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
commit 7d4a8f4724ea8f82709550d8a55798c87bfab802 (HEAD, refs/heads/clj-1299-no-nil) | |
Author: Toby Crawley <[email protected]> | |
Date: Fri Nov 22 09:49:44 2013 -0500 | |
Prevent a conveyed binding frame from being removed by a popThreadBindings call [CLJ-1299] | |
This introduces a TOP frame that is used to mark the top of a | |
push/pop stack. It also removes unnecessary nil checks around dvals. | |
Modified src/jvm/clojure/lang/Var.java |
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
Changes: | |
Modified src/jvm/clojure/lang/Var.java | |
diff --git a/src/jvm/clojure/lang/Var.java b/src/jvm/clojure/lang/Var.java | |
index 7463337..2dee064 100644 | |
--- a/src/jvm/clojure/lang/Var.java | |
+++ b/src/jvm/clojure/lang/Var.java | |
@@ -63,8 +63,8 @@ static class Frame{ | |
} | |
protected Object clone() { |