Skip to content

Instantly share code, notes, and snippets.

Sean Cribbs seancribbs

View GitHub Profile
View reduce.ex
# This function is only included for context - it creates a multi-operation transaction structure
# for a single widget and its associated options
def create_multi(params, operation_type, widget, identifier \\ :widget) do
changeset = Widget.changeset(widget, params)
apply(Ecto.Multi, operation_type, [, identifier, changeset])
|> maybe_merge_widget_options(identifier, params)
# Here's the usage of reduce. Notice the map + "mappend"(?) inside the reduce. If Ecto.Multi
View alchemist-mix-format-spacemacs.el
;; Support mix format command
(defun alchemist-mix-format (&optional prefix)
"Runs mix format in the project"
(alchemist-mix-execute (list "format") prefix))
(defun alchemist-mix-format-buffer (&optional prefix)
"Runs mix format on the current buffer"
View print_code.ex
defmodule Mix.Tasks.PrintCode do
@shortdoc "Prints decompiled Erlang source for a module"
@moduledoc """
Pretty-prints the *Erlang-equivalent* source code of an *Elixir*
module. This is useful for understanding how particular Elixir
features (e.g. macros, protocols) operate under the covers.
*Erlang modules are not yet supported.*
seancribbs /
Last active Jul 29, 2017
Resources for my talk "Adopting Stream Processing for Instrumentation" at QCon New York 2017
seancribbs / init.el
Last active Aug 22, 2017
View init.el
;; Use org-babel to load config
(require 'org)
(org-babel-load-file (expand-file-name "" user-emacs-directory))
seancribbs / ifelse.erl
Last active Nov 19, 2015
IF / ELSE in erlang, via parse_transform. EVIL, DO NOT USE
View ifelse.erl
%% @doc A VERY EVIL parse_transform that allows two things:
%% 1) The use of 'else' instead of 'true' in the final clause of an if
%% expression.
%% 2) Automatic extraction of non-guard expressions into
%% anonymous variables that can then be used directly in the clause
%% guards.
%% Until Erlang actually implements the 'cond' construct, this is a
View gist:1c59b5dc1aa50b83c53e
** (Protocol.UndefinedError) protocol String.Chars not implemented for {:git, 'git://', {:tag, '2.1.1'}}
(elixir) lib/string/chars.ex:3: String.Chars.impl_for!/1
(elixir) lib/string/chars.ex:17: String.Chars.to_string/1
(mix) lib/mix/rebar.ex:122: Mix.Rebar.compile_req/1
(mix) lib/mix/rebar.ex:88: Mix.Rebar.parse_dep/2
(elixir) lib/enum.ex:977: anonymous fn/3 in
(elixir) lib/enum.ex:1261: Enum."-reduce/3-lists^foldl/2-0-"/3
(elixir) lib/enum.ex:977:
(mix) lib/mix/dep/loader.ex:250: anonymous fn/2 in Mix.Dep.Loader.rebar_children/1

Keybase proof

I hereby claim:

  • I am seancribbs on github.
  • I am seancribbs ( on keybase.
  • I have a public key whose fingerprint is C40B E0F2 EA7F B696 8D69 E1D1 2AAA 6B61 8089 7A6C

To claim this, I am signing this object:

View .bash_profile
# Customizations
. ~/.bash/
. ~/.bash/
. ~/.bash/
. ~/.bash/
. ~/.bash/
. ~/.bash/
. ~/.bash/
. ~/.bash/
View neotoma_generate.erl
%% @doc Implements code-generation using syntax_tools.
-import(erl_syntax, [
You can’t perform that action at this time.