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
View gist:52af4d838f376d745513
$ bin/rails console
Loading development environment (Rails 4.1.7)
irb(main):001:0> Article.search_for_ids "crisis"
Sphinx Query (3.0ms) SELECT * FROM `article_core` WHERE MATCH('crisis') AND `sphinx_deleted` = 0 LIMIT 0, 20
(Object doesn't support #inspect)
=>
irb(main):002:0> _.to_a
Sphinx Retrying query "SELECT * FROM `article_core` WHERE MATCH('crisis') AND `sphinx_deleted` = 0 LIMIT 0, 20; SHOW META" after error: Lost connection to MySQL server during query - SELECT * FROM `article_core` WHERE MATCH('crisis') AND `sphinx_deleted` = 0 LIMIT 0, 20; SHOW META
Sphinx Query (1.7ms) SELECT * FROM `article_core` WHERE MATCH('crisis') AND `sphinx_deleted` = 0 LIMIT 0, 20
NoMethodError: undefined method `inject' for nil:NilClass
View crdt_mapred.erl
-module(crdt_mapred).
-compile(export_all).
%% @doc Map phase function for returning CRDT set values as lists of lists
map_set_value(RiakObject, _, _) ->
[riak_kv_crdt:set_value(RiakObject)].
%% @doc Map phase function for returning CRDT set values wrapped in JSON-like objects
map_set_value_json(RiakObject, _, _) ->
[{struct, [{set, riak_kv_crdt:set_value(RiakObject)}]}].
View erlang.el
;; erlang-mode and customizations
(add-to-list 'load-path "/Users/sean/erlang/R16B02/lib/erlang/lib/tools-2.6.12/emacs")
(add-to-list 'exec-path "/Users/sean/erlang/R16B02/bin")
(setq erlang-root-dir "/Users/sean/erlang/R16B02/lib/erlang")
(require 'erlang-start)
(require 'erlang-flymake)
(setq erlang-flymake-command "/Users/sean/erlang/R16B02/bin/erlc")
View erlang.sh
# Erlang switching
export PATH="$HOME/erlang/current/bin:$PATH"
# Detects the current erlang version
erlcur() {
DIR=`ls -lr $HOME/erlang | awk '/current/ { print $NF }'`
echo -n ${DIR##*/}
}
# Switches to the given erlang version using wildcards
View edoc_stats.erl
%% @doc Reports on percentage of modules, functions and types that are
%% documented.
-module(edoc_stats).
-export([file/1, file/2, files/1, files/2, aggregate/1, report/1, report_files/1, report_files/2]).
-include_lib("xmerl/include/xmerl.hrl").
-import(xmerl_xpath, [string/2]).
-define(QUERY_FUNS, [ fun module_has_description/2
, fun functions_have_descriptions/2
, fun types_have_descriptions/2
View gist:7dfa846d8b3b33b80f92
Last 10 lines of the build log ( /Users/sean/.cabal/logs/protocol-buffers-2.0.14.log ):
Text/ProtocolBuffers/WireMessage.hs:407:24: Not in scope: ‘typeOf’
Text/ProtocolBuffers/WireMessage.hs:433:77: Not in scope: ‘typeOf’
Text/ProtocolBuffers/WireMessage.hs:436:75: Not in scope: ‘typeOf’
Text/ProtocolBuffers/WireMessage.hs:440:74: Not in scope: ‘typeOf’
View isotime.erl
isotime({{Y,Mo,D},{H,Mi,S}}) ->
ISO = io_lib:format("~w-~.2.0w-~.2.0wT~.2.0w:~.2.0w:~6.3.0fZ",
[Y, Mo, D, H, Mi, S]),
unicode:characters_to_binary(ISO).
View pizza.md

Okay, here are some of my tips about how I work with the pizza dough. For now, I'd suggest just buying the dough until you're comfortable, then once you've got the basic techniques down you can start experimenting and/or making your own dough. We get ours at Whole Foods (it's about $5/ball, it's 22 oz., and it'll make about three pizzas on the Baking Steel), but you can get it from a grocery store that makes pizzas or a pizza restaurant.. They'll usually sell it to you if you ask for it. I describe my process with the 3-pizza thing in mind.

Setting the stage

When you buy your dough it will usually be cold, and that cold is the enemy of smooth pizza making. You'll need to let the dough come to room temperature: We usually pull out three round plastic Ziploc containers, spray the containers lightly with non-stick kitchen spray, plop the cold dough into the container, then spray a small square of regular Saran wrap lightly with non-stick spray and cover the top of the containers. You want to block out the o

View ack.txt
src/riak.erl:183: {error, notfound} ->
src/riak_client.erl:71:%% {error, notfound} |
src/riak_client.erl:105: notfound ->
src/riak_client.erl:106: {error, notfound};
src/riak_client.erl:114:%% {error, notfound} |
src/riak_client.erl:134:%% {error, notfound} |
src/riak_client.erl:148:%% {error, notfound} |
src/riak_client.erl:246:%% {error, notfound} |
src/riak_client.erl:312:%% {error, notfound} |
src/riak_client.erl:323:%% {error, notfound} |
View sanity.hrl
-define(maybe(Bool, Exprs),
if (Bool) -> (Exprs), ok;
true -> ok
end).
You can’t perform that action at this time.