This file contains hidden or 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 projectile-cleanup-project-buffers () | |
(interactive) | |
(dolist (buffer (projectile-project-buffer-names)) | |
(condition-case nil | |
(with-current-buffer buffer | |
(esk-cleanup-buffer)) | |
(buffer-read-only nil)))) | |
(defun projectile-current-project-file-full-paths () | |
(let ((root (projectile-project-root))) |
This file contains hidden or 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 set-default-timezone | |
"Why: because when we read the data out of Redshift, the java.sql.Timestamps | |
that are retrieved will pickup the (TimeZone/getDefault). | |
This kind of thing must also be done in any reporting that pulls this data. | |
At which time should be calling to that production code instead of this test | |
setup HACK." | |
[test-fn] | |
(let [original-tz (TimeZone/getDefault)] | |
(try |
This file contains hidden or 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
(defmacro doseq-tests | |
"Labels each case with an test-num starting from one." | |
[bindings & body] | |
`(let [test-num# (atom 0) | |
bindings-vec# '~(vec (first (rest bindings)))] | |
(doseq ~bindings | |
(testing (str "\n #" @test-num# ": " (get bindings-vec# @test-num#)) | |
(swap! test-num# inc) | |
~@body)))) |
This file contains hidden or 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
module Tasks | |
def self.ls | |
`ls .` | |
end | |
end | |
def run(args) | |
puts Tasks.send(args[0]) | |
end |
This file contains hidden or 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 '[hiccup.core :as hiccup]) | |
(def nav-links [{:url "a.html" | |
:text "Resume"} | |
{:url "b.html" | |
:text "Blog"} | |
{:url "c.html" | |
:text "About"}]) | |
(defn nav-hiccup [nav-links] |
This file contains hidden or 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 '[stencil.core :as s]) | |
(def nav-links [{:url "a.html" | |
:text "Resume"} | |
{:url "b.html" | |
:text "Blog"} | |
{:url "c.html" | |
:text "About"}]) | |
(defn nav [links] |
This file contains hidden or 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 '[stencil.core :as s]) | |
(def nav-links [{:url "a.html" | |
:text "Resume"} | |
{:url "b.html" | |
:text "Blog"} | |
{:url "c.html" | |
:text "About"}]) | |
(defn nav [links] |
This file contains hidden or 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 | |
line=$(git log | head | sed -n 1p) | |
echo "${line:7 :${#line}-1}" |
This file contains hidden or 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
iex(1)> expr = quote do: Unless.macro_unless(true, IO.puts "this should never be printed") | |
{{:., [], [{:__aliases__, [alias: false], [:Unless]}, :macro_unless]}, [], | |
[true, | |
{{:., [], [{:__aliases__, [alias: false], [:IO]}, :puts]}, [], | |
["this should never be printed"]}]} | |
iex(2)> res = Macro.expand_once(expr, __ENV__) | |
{{:., [], [{:__aliases__, [alias: false], [:Unless]}, :macro_unless]}, [], | |
[true, | |
{{:., [], [{:__aliases__, [alias: false], [:IO]}, :puts]}, [], | |
["this should never be printed"]}]} |
This file contains hidden or 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
Type checking ./05-Lists.idr | |
05-Lists.idr:6:6:When elaborating right hand side of nats: | |
Can't disambiguate name: Prelude.List.::, | |
Prelude.Stream.::, | |
Prelude.Vect.:: | |
05-Lists.idr:58:10:When elaborating right hand side of stopPete: | |
When elaborating an application of function Prelude.Classes.==: | |
Can't disambiguate name: Prelude.List.::, | |
Prelude.Stream.::, | |
Prelude.Vect.:: |