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
(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 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
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
require 'torquebox-web' | |
require 'torquebox-messaging' | |
topic = TorqueBox::Messaging::Topic.new('browser-messages') | |
TorqueBox::Web::Server.sockjs('/messages').on_connection do |conn| | |
listener = topic.listen do |m| | |
conn.write(m) | |
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
-*- mode: grep; default-directory: "~/w/immutant/immutant/" -*- | |
Grep started at Wed Aug 20 14:01:10 | |
git --no-pager grep --no-color -n -e "TODO" -- "*.*" | |
etc/bin/ci-prep-wildfly.sh:20:# TODO: domain mode | |
etc/build-helper/src/build_helper/docs.clj:21: (update-in project [:dependencies] conj '[org.immutant/build-helper "0.1.6"]) ;; TODO: don't hardcode this version? | |
messaging/src/immutant/messaging.clj:139: TODO: more docs/examples" | |
messaging/test/immutant/messaging/pipeline_test.clj:359: (println "NOTE: pipeline record test disabled out-of-container, as it will fail. TODO: fix it"))) | |
web/test/immutant/web/websocket_test.clj:92: ;; TODO: bug in undertow! (is (= "/?x=y&j=k" (-> handshake uri str))) | |
wildfly/src/immutant/wildfly.clj:116: ;; TODO: figure out where to store/get the web-context |
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
(deftask eval | |
"eval some stuff" | |
[e eval CODE [str] "code snippets to eval"] | |
(with-pre-wrap fileset | |
(doseq [e eval] | |
(clojure.core/eval (read-string e))) | |
fileset)) |
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
#!/bin/bash | |
IN="LVDS1" | |
EXT="HDMI3" | |
if (xrandr | grep "$EXT disconnected"); then | |
xrandr -d :0.0 --output $IN --auto --output $EXT --off | |
else | |
xrandr -d :0.0 --output $IN --auto --output $EXT --auto --right-of $IN --primary | |
fi |
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
get '/' do | |
haml :index | |
end | |
post '/unwind' do | |
@url, @unwound_url, @unwind_error = unwind(params[:url]) | |
haml :index | |
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
def test_index | |
get_it '/' | |
assert_match /Unwind It/, @response.body | |
end | |
def test_unwind_with_blank_url | |
post_it '/unwind', :url => '' | |
assert_match /Please enter/, @response.body | |
end |
OlderNewer