Skip to content

Instantly share code, notes, and snippets.

@ericbmerritt
ericbmerritt / gist:2006851
Created March 9, 2012 14:55
elisp for opening emacs in emacs
;;;
;;; Eshell stuff
;;;
(when (fboundp 'eshell)
;; This and rmb are my two vices. rmb is defined as an eshell alias.
(defalias 'eshell/lo #'eshell/exit)
(defalias 'eshell/logout #'save-buffers-kill-emacs)
;; I'm obsessive/compulsive with clear.
This technology allows you to implement distributed systems using
proven algorithms in well tested implementations (riak and
riak_core). If you don't grok distributed systems, rely on folks
that do.
Eric B. Merritt
Afiniate, CTO
@ericbmerritt
ericbmerritt / gist:1556075
Created January 3, 2012 17:53
Example spec syntax for joxa
(module jxat-spec test)
(deftype+ foo (bar baz) {bar baz})
(deftype boo () :ok)
(deftype+ hoo (a) a)
(defspec internal-test () (foo :this :is))
(defn internal-test ()
{:this :is :a :test})
-module(jxat_lexer_proper).
-include_lib("proper/include/proper.hrl").
to_string({ident, _, Ident}) ->
Ident;
to_string({char, _, Char}) ->
[$\\, Char];
to_string({syntax_quote, 0, "`"}) ->
"`";
keyword_style_ident() ->
":" ++ string().
defvar_style_ident() ->
"*" ++ string() ++ "*".
split_ident() ->
string() ++ "-" ++ string().
normal_ident() ->
?FORALL({FunName, ArgName, Op}, {ident(), ident(), op()},
begin
Expr = lists:flatten(
io_lib:format("(defn ~s [~s] (~s (mod ~s) 0))",
[FunName, ArgName, Op, ArgName])),
Tokens = jxa_lex:lex(Expr),
[] == Tokens
end).
@ericbmerritt
ericbmerritt / gist:1019166
Created June 10, 2011 16:08
highlight extent
;;;###autoload
(defun ispell-hl-minor-mode (&optional arg)
"Toggle Ispell Highlight mode.
With prefix ARG, turn Ispell Highlight mode on if arg is positive.
In Ispell Highlight mode, changing the buffer contens will spell
the words around the cursor and highlight miss-spelled ones!"
(interactive "P")
(setq ispell-hl-minor-mode
(not (or (and (null arg) ispell-hl-minor-mode)
{ok, RawCDs} = core_cds:find_all(),
FilteredCDs = lists:filter(fun(CD) ->
Now = date(),
case ecdm_cd:maturity_date(CD) of
undefined ->
true;
Value when Value < Now ->
true;
_ ->