Skip to content

Instantly share code, notes, and snippets.

; CIDER 0.7.0 (Java 1.7.0_55, Clojure 1.6.0, nREPL 0.2.3, cider-nrepl 0.7.0)
WARNING: The following required nREPL ops are not supported:
classpath complete info inspect-start inspect-refresh inspect-pop inspect-push inspect-reset macroexpand macroexpand-1 macroexpand-all resource stacktrace toggle-trace
Please, install (or update) cider-nrepl 0.7.0 and restart CIDER
kanfold.repl>
; CIDER 0.8.0snapshot (package: 20140808.646) (Java 1.7.0_55, Clojure 1.6.0, nREPL 0.2.3, cider-nrepl 0.8.0-snapshot)
WARNING: The following required nREPL ops are not supported:
classpath complete info inspect-start inspect-refresh inspect-pop inspect-push inspect-reset macroexpand macroexpand-1 macroexpand-all resource stacktrace toggle-trace
Please, install (or update) cider-nrepl 0.8.0-snapshot and restart CIDER
#!/bin/bash
# -*- shell-script -*-
emacs -batch -l ert-bootstrap.el -l elixir-mode-tests.el -f ert-run-tests-batch-and-exit 2> /dev/null
if [ $? == 0 ]; then
echo "Success"
else
echo "Fail"
fi
#/bin/sh
#
# This is a script which sets the lib path then launches BBT
# The program location
TOP=$(cd "${0%/*}" && echo ${PWD})
PROGRAM="${TOP}/BattleBlockTheater"
# Add the current directory to the library path to pick up libsteam_api.so
(defun smie-indent-comment ()
"Compute indentation of a comment."
;; Don't do it for virtual indentations. We should normally never be "in
;; front of a comment" when doing virtual-indentation anyway. And if we are
;; (as can happen in octave-mode), moving forward can lead to inf-loops.
(and (smie-indent--bolp)
(let ((pos (point)))
(save-excursion
(beginning-of-line)
(and (re-search-forward comment-start-skip (line-end-position) t)
Buffer: *Test buffer (elixir-ert-indents-use-dot-module-newline): (Expected)*<2>
Buffer: *Test buffer (elixir-ert-indents-use-dot-module-newline): (Actual)*<2>
(ert-test-failed
((should
(equal indented "\ndefmodule Foo do\n use GenServer.Behaviour\n\n def foobar do\n if true, do: IO.puts \"yay\"\n end\nend"))
:form
(equal "\ndefmodule Foo do\n use GenServer.Behaviour\n\n def foobar do\n if true, do: IO.puts \"yay\"\n end\nend" "\ndefmodule Foo do\n use GenServer.Behaviour\n\n def foobar do\n if true, do: IO.puts \"yay\"\n end\nend")
:value nil :explanation
(arrays-of-different-length 143 101 "\ndefmodule Foo do\n use GenServer.Behaviour\n\n def foobar do\n if true, do: IO.puts \"yay\"\n end\nend" "\ndefmodule Foo do\n use GenServer.Behaviour\n\n def foobar do\n if true, do: IO.puts \"yay\"\n end\nend" first-mismatch-at 47)))
match (c1:City), (c2:City), p = (c1)-[r*..6]-(c2)
where c2.name = "New York" and c1.name = "Dallas" and
length([x in nodes(p) where x.name in ["Little Rock", "Saint Louis", "Pittsburgh", "Duluth", "Kansas City", c1.name, c2.name]]) = length(nodes(p))
return distinct p;
(defn group-by-many
"Like `group-by', but allows grouping by multiple keys.
Example:
(group-by-many [{:a 1 :b 2 :c 3} {:a 7 :b 12 :c -4}] [:a :c])
>>> {#{1 3} {:a 1 :b 2 :c 3} #{7 -4} {:a 7 :b 12 :c -4}}
"
[ks m]
(let [f (fn [x]
match (c1:City {name: "New York"}),
(c2:City {name: "Seattle"}),
p = allShortestPaths((c2)-[*]-(c1))
return distinct reduce(routeDesc = "", n in nodes(p) |
routeDesc + n.name + " -> ") as routeDesc,
reduce(totalCost = 0, r in relationships(p) |
totalCost + r.cost) as routeCost;
/*
+---------------------------------------------------------------------------------------------+