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 this to ~/.emacs | |
;; Missing from ruby-mode.el, see https://groups.google.com/group/emacs-on-rails/msg/565fba8263233c28 | |
(defun ruby-insert-end () | |
"Insert \"end\" at point and reindent current line." | |
(interactive) | |
(insert "end") | |
(ruby-indent-line t) | |
(end-of-line)) |
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
(defproject foo "1.0.0-SNAPSHOT" | |
:description "FIXME: write description" | |
:dependencies [[org.clojure/clojure "1.3.0"] | |
[org.clojure/clojurescript "0.0-927"]]) |
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
;;; data.json 0.1.x compatibility shim | |
;; Loading this file alongside data.json version 0.2.0 adds | |
;; definitions which make it compatible with the public API of | |
;; data.json version 0.1.3. | |
;; Copyright (c) Stuart Sierra, 2012. All rights reserved. The use and | |
;; distribution terms for this software are covered by the Eclipse | |
;; Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) |
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
;; Demonstration of JVM dead code elimination in Clojure 1.2 and 1.5 | |
;; | |
;; This Clojure script demonstrates some of the effects of dead code | |
;; elimination in the JVM. For unknown reasons, the bytecode produced | |
;; by Clojure 1.2.1 is more susceptible to elimination than the | |
;; bytecode produced by Clojure 1.5.1, making it seem like 1.2.1 is | |
;; faster. But when the code is forced to do real work, the difference | |
;; disappears. | |
;; | |
;; My results with Clojure 1.2.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
package example; | |
import java.math.BigInteger; | |
public class Factorial { | |
public static BigInteger factorial(final int n) { | |
BigInteger res = BigInteger.valueOf(1L); //build upresult | |
for (int i = n; i > 1; i--) | |
res = res.multiply(BigInteger.valueOf(i)); | |
return res; |
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
;; Maze Jam from Lambda Jam 2013, Chicago | |
;; | |
;; by Stuart Sierra, http://stuartsierra.com/ | |
;; | |
;; There are probably bugs in this code. | |
;; | |
;; Copyright (c) 2013 Stuart Sierra | |
;; All rights reserved. | |
;; | |
;; Redistribution and use in source and binary forms, with or without |
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
(defproject your-project "0.1.0-SNAPSHOT" | |
:dependencies [[org.clojure/clojure "1.5.1"] | |
[org.clojure/clojurescript "0.0-1845-RC1"]] | |
:repositories {"sonatype-staging" | |
"https://oss.sonatype.org/content/groups/staging/"}) |
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
[INFO] Scanning for projects... | |
[INFO] | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] Building system-test 0.1.0-SNAPSHOT | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] | |
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ system-test --- | |
[INFO] <<<REDACTED>>> | |
[INFO] +- org.clojure:clojure:jar:1.5.1:compile | |
[INFO] +- <<<REDACTED>>> |
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
(defproject cljsfoo1 "0.1.0-SNAPSHOT" | |
:plugins [[lein-cljsbuild "0.3.4"] | |
[com.cemerick/austin "0.1.1"]] | |
:dependencies [[org.clojure/clojure "1.5.1"] | |
[org.clojure/clojurescript "0.0-1934"] | |
[ring "1.2.0"] | |
[compojure "1.1.5"] | |
[enlive "1.1.1"]] | |
:source-paths ["src/clj" "src/cljs"] | |
:cljsbuild {:builds |
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
ERROR in (some-test) (Reflector.java:432) | |
Uncaught exception, not in assertion. | |
expected: nil | |
actual: | |
at java.util.regex.Matcher.getTextLength(Matcher.java:1233) | |
at java.util.regex.Matcher.reset(Matcher.java:308) | |
at java.util.regex.Matcher.<init>(Matcher.java:228) | |
at java.util.regex.Pattern.matcher(Pattern.java:1088) | |
at clj_stacktrace.utils$re_gsub.invoke(utils.clj:6) | |
at clj_stacktrace.core$clojure_ns.invoke(core.clj:14) |