Skip to content

Instantly share code, notes, and snippets.

Sean Cribbs seancribbs

Block or report user

Report or block seancribbs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
seancribbs /
Last active Jan 21, 2020
Presentation source, code examples and exercises from "Getting Started with eunit", Chicago Erlang March 2014

Getting Started with eunit

seancribbs / application.rb
Created Aug 5, 2010
Code from the "Riak with Rails" webinar
View application.rb
# Add this line to your config/application.rb to enable
# initialization of Ripple, after the other framework railties
require 'ripple/railtie'
# To use the Riak cache store, place this line inside the
# Application class
config.cache_store = :riak_store
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.*
View gist:7806229
$ ack app_helper:get_env src
src/riak_client.erl:759: case app_helper:get_env(riak_kv, overload_backoff, undefined) of
src/riak_index.erl:444: Timeout = app_helper:get_env(riak_kv, secondary_index_timeout, ?DEFAULT_TIMEOUT),
src/riak_kv_app.erl:51: FSM_Limit = app_helper:get_env(riak_kv, fsm_limit, ?DEFAULT_FSM_LIMIT),
src/riak_kv_app.erl:60: case app_helper:get_env(riak_kv, direct_stats, false) of
src/riak_kv_app.erl:72: case app_helper:get_env(riak_kv, add_paths) of
src/riak_kv_app.erl:100: StorageBackend = app_helper:get_env(riak_kv, storage_backend),
src/riak_kv_app.erl:193: HealthCheckOn = app_helper:get_env(riak_kv, enable_health_checks, false),
src/riak_kv_app.erl:273: {Low, High} = app_helper:get_env(riak_kv, vnode_mailbox_limit, {1, 5000}),
src/riak_kv_app.erl:324: case app_helper:get_env(riak_kv, object_format, v0) of
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 /
Last active Jul 29, 2017
Resources for my talk "Adopting Stream Processing for Instrumentation" at QCon New York 2017
View riak_core.txt
~/dev/riak/deps/riak_core R16B02-basho3 [(detached from 699324c)@699324c]
$ ./rebar list-deps deps_dir=.. | grep -v "==>" | sort | uniq
basho_stats BRANCH develop git://
bear TAG 0.1.3p1 git://
cuttlefish BRANCH develop git://
eleveldb BRANCH develop git://
folsom TAG 0.7.4p4 git://
getopt TAG v0.4.3 git://
goldrush TAG 0.1.5 git://
lager TAG 2.0.1 git://
View python.txt
>>> urllib.URLopener().open('')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 208, in open
return getattr(self, name)(url)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 437, in open_https
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 969, in endheaders
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 829, in _send_output
You can’t perform that action at this time.