Skip to content

Instantly share code, notes, and snippets.

View AlexBaranosky's full-sized avatar

AlexBaranosky AlexBaranosky

  • Cisco Secure Malware Analytics (formerly Threat Grid)
  • Massachusetts
  • 05:29 (UTC -04:00)
View GitHub Profile
(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)))
(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
(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))))
module Tasks
def self.ls
`ls .`
end
end
def run(args)
puts Tasks.send(args[0])
end
(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]
(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]
(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]
#!/bin/bash
line=$(git log | head | sed -n 1p)
echo "${line:7 :${#line}-1}"
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"]}]}
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.::