Skip to content

Instantly share code, notes, and snippets.

@flyingmachine
flyingmachine / hang.clj
Created Oct 14, 2014
http-kit client hanging
View hang.clj
(defn app [req]
{:status 200
:headers {"Last-Modified" "Wed, 28 May 2014 19:41:37 GMT", "Content-Length" "2"}
:body "ok"})
(org.httpkit.server/run-server app {:port 7071})
@(org.httpkit.client/get "http://localhost:7071" {:timeout 500})
; => {:opts {:url "http://localhost:7071", :method :get, :timeout 500}, :error #<TimeoutException org.httpkit.client.TimeoutException: read timeout: 500ms>}
View enqueue-expansion.clj
(let [saying (promise)]
(future (deliver saying (do (wait 100 "Cheerio!"))))
@(let [saying (promise)]
(future (deliver saying (do (wait 400 "Pip pip!"))))
@(let [saying (promise)]
(future (deliver saying (do (wait 200 (println "'Ello, gov'na!")))))
(println @saying)
saying)
(println @saying)
saying)
View build.boot
(set-env!
:source-paths #{"src/clj" "src/cljs"}
:resource-paths #{"resources"}
:dependencies '[[adzerk/boot-cljs "0.0-2814-4"]
[adzerk/boot-cljs-repl "0.1.10-SNAPSHOT" :scope "test"]
[adzerk/boot-reload "0.2.6" :scope "test"]
[environ "1.0.0"]
[danielsz/boot-environ "0.0.1"]
[org.clojure/core.async "0.1.346.0-17112a-alpha"]
View gist:68235370de0ef802d0dd
[!] clj-time
✔ 0.6.0
ring/ring-core
✘ 0.5.0
cljs-ajax
[✔] org.clojure/clojure
✘ 1.7.0-beta2
cljs-ajax
✔ 1.7.0-RC2
org.clojure/clojure
@flyingmachine
flyingmachine / try1.clj
Created Jul 3, 2015
trying to get CSSTransitionGroup 0.13.3 working with Om 0.8.8
View try1.clj
(ns pleasework.app
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]))
(enable-console-print!)
(def app-state (atom {}))
(def ctg (-> js/React (aget "addons") (aget "CSSTransitionGroup")))
View application.css
@charset "UTF-8";
@import url(http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,400,300,600,700);
@import url(http://fonts.googleapis.com/css?family=Source+Code+Pro:400,600);
@-webkit-keyframes blinking {
0% {
opacity: 1; }
50% {
opacity: 0; }
100% {
opacity: 1; } }
View gist:11581
# POST data for an individual listing
actAddJobToCart.requisitionNo
actDisplayProfiler.candidateNo
actDisplayProfiler.mode
actDisplayProfiler.requisitionNo
actDisplayReferralProfiler.candidateNo
actDisplayReferralProfiler.mode
actDisplayReferralProfiler.requisitionNo
actNbElementByPage.target
View gist:2039406
function addTodo()
{
var a = document.getElementById('list').getElementsByTagName('li')[0].firstChild.nodeValue;
var x=document.getElementById("nameOfItem").value;
if(x.length==""){
alert("Please eneter a ToDo item.");
}
else if(x.length > 200)
{
View gist:2905038
export CLASSPATH="/Users/daniel/jars/clojure-1.4.0/clojure-1.4.0.jar:$CLASSPATH"
alias "cljrepl"="java clojure.main"
View gist:2929345
;; env PATH
(when (equal system-type 'darwin)
(setenv "PATH" (concat "/opt/local/bin:/usr/local/bin:" (getenv "PATH")))
(push "/opt/local/bin" exec-path)
(push "/usr/local/bin" exec-path))
;; text
(set-face-attribute 'default nil :height 140)
(load-theme 'deeper-blue)