View gist:243175
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 get-stream [] | |
(let [conn #^java.net.HttpURLConnection | |
(http-connection "http://stream.twitter.com/1/statuses/sample.json")] | |
(.setDoInput conn true) | |
(.setRequestProperty conn | |
"Authorization" | |
(str "Basic " (base64/encode-str | |
"USERNAME:PASSWORD"))) | |
(.getInputStream conn))) |
View gist:249745
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
diff --git a/src/couchdb/client.clj b/src/couchdb/client.clj | |
index 4567df0..e4ccb82 100644 | |
--- a/src/couchdb/client.clj | |
+++ b/src/couchdb/client.clj | |
@@ -154,12 +154,12 @@ | |
([server database] | |
(when-let [database (validate-dbname database)] | |
(map :id (:rows (:json (couch-request (str server database "/_all_docs"))))))) | |
- ([server database options] | |
+ ([server database & [options]] |
View .emacs
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
(defun copy-from-osx () | |
(shell-command-to-string "pbpaste")) | |
(defun paste-to-osx (text &optional push) | |
(let ((process-connection-type nil)) | |
(let ((proc (start-process "pbcopy" "*Messages*" "pbcopy"))) | |
(process-send-string proc text) | |
(process-send-eof proc)))) | |
(setq interprogram-cut-function 'paste-to-osx) |
View 1*
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
swank.util.io.proxy$java.io.StringWriter$0 cannot be cast to java.io.PrintWriter | |
[Thrown class java.lang.ClassCastException] | |
Restarts: | |
0: [ABORT] Return to SLIME's top level. | |
Backtrace: |
View 4*
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
swank.util.io.proxy$java.io.StringWriter$0 cannot be cast to java.io.PrintWriter | |
[Thrown class java.lang.ClassCastException] | |
Restarts: | |
0: [ABORT] Return to SLIME's top level. | |
Backtrace: | |
0: clojure.lang.Compiler$InstanceFieldExpr.<init>(Compiler.java:920) | |
1: clojure.lang.Compiler$HostExpr$Parser.parse(Compiler.java:798) | |
2: clojure.lang.Compiler.analyzeSeq(Compiler.java:4592) |
View gist:267299
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
; SLIME 20091016 | |
user> ;; How to break swank-clojure | |
nil | |
user> ;; This is a clean repl started with M-x swank-clojure-project, nothing was required until now | |
nil | |
user> (do | |
(set! *warn-on-reflection* true) | |
(set! *print-level* 4) | |
(set! *print-length* 30)) | |
30 |
View gist:273526
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
(let [x (+ (foo a b) | |
(bar c d))] | |
(print x)) |
View Mathematik.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
int fib(int n) { | |
//Spezielfaelle bei n < 3 | |
// fib(0) == 0, fib(1) == 1, fib(2) == 1 | |
if(n == 0) | |
return 0; | |
else if(n == 1 || n == 2) | |
return 1; | |
// Variablendeklarationen | |
// f = aktuelle fibonaccizahl, |
View *slime-repl clojure*
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
user> (use 'vijual) | |
nil | |
user> (draw-tree [[:north-america [:usa [:miami] [:seattle] [:idaho [:boise]]]] [:europe [:germany] [:france [:paris] [:lyon] [:cannes]]]]) | |
+------------+ +--------+ | |
| north | | europe | | |
| america | +----+---+ | |
+------+-----+ | | |
| +---------+---------+ | |
+ | | | |
| +----+----+ +---+----+ |
View *slime-scratch*
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
(reduce #(if (and (string? %2) (string? (last %1))) | |
(conj (vec (drop-last %1)) (str (last %1) %2)) | |
(conj %1 %2)) | |
[] [1 2 "foo" "bar" 42 5]) |
OlderNewer