Skip to content

Instantly share code, notes, and snippets.

View seth's full-sized avatar

Seth Falcon seth

View GitHub Profile
rand_v <- function(n, pct.true, use.names = FALSE, use.na = FALSE)
{
vals <- c(TRUE, FALSE)
probs <- c(pct.true, (1 - pct.true))
if (use.na) {
vals <- c(vals, NA)
pct.o <- (1 - pct.true) / 2
probs <- c(pct.true, pct.o, pct.o)
}
v <- sample(vals, size = n, replace = TRUE, prob = probs)
#!/usr/bin/env ruby
def find_deps(cookbook_dir)
nel = Hash.new { |h, k| h[k] = [] }
Dir.glob("#{cookbook_dir}/*/").each do |r|
deps_for(r, nel)
end
nel
end
;; ESS
(add-to-list 'load-path "~/src/ESS/lisp")
(require 'ess-site)
(setq ess-S-assign-key (kbd "C-="))
(ess-toggle-S-assign-key t) ; enable above key definition
;; leave my underscore key alone!
(ess-toggle-underscore nil)
(setq ess-r-versions '("R-"))
(setq ess-use-inferior-program-name-in-buffer-name t)
(add-to-list 'auto-mode-alist '("\\.Rd\\'" . Rd-mode))
[hoop] src/riak: make all (git)-[master]-
make: hg: Command not found
./rebar get-deps
==> luke (get-deps)
==> riak_core (get-deps)
==> riak_kv (get-deps)
==> rel (get-deps)
==> riak (get-deps)
Pulling erlang_js from {hg,"http://bitbucket.org/basho/erlang_js","81"}
ERROR: Rebar requires version {1,1} or higher of hg
module ExampleHelpers
def do_something_great(x)
x + 1
end
end
class Chef::Resource
include ExampleHelpers
end
/Library/Ruby/Gems/1.8/gems/vagrant-0.4.2/lib/vagrant/environment.rb:44:in `check_virtualbox!': undefined method `error_and_exit' for Vagrant::Environment:Class (NoMethodError)
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2/lib/vagrant/environment.rb:141:in `load!'
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2/lib/vagrant/environment.rb:33:in `load!'
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2/lib/vagrant/command.rb:12:in `execute'
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2/bin/vagrant:7
from /usr/bin/vagrant:19:in `load'
from /usr/bin/vagrant:19
diff --git a/cookbooks/mysql/attributes/server.rb b/cookbooks/mysql/attributes/server.rb
index af13a03..4a2dc35 100644
--- a/cookbooks/mysql/attributes/server.rb
+++ b/cookbooks/mysql/attributes/server.rb
@@ -19,9 +19,9 @@
::Chef::Node.send(:include, Opscode::OpenSSL::Password)
-default[:mysql][:server_debian_password] = secure_password
-default[:mysql][:server_root_password] = secure_password
Erlang R13B04 (erts-5.7.5) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.7.5 (abort with ^G)
1> {ok, Pid} = riakc_pb_socket:start_link("127.0.0.1", 8091).
{ok,<0.34.0>}
2> riakc_pb_socket:ping(Pid).
** exception exit: {timeout,{gen_server,call,[<0.34.0>,{req,rpbpingreq}]}}
in function gen_server:call/2
25> X1 = riakc_obj:new(<<"b">>, <<"k">>, <<"{\"v\":1}">>, "application/json").
{riakc_obj,<<"b">>,<<"k">>,undefined,[],
{dict,1,16,16,8,80,48,
{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],...},
{{[],[],[],[],[],[],[],[],[],[],[[<<...>>|...]],[],[],...}}},
<<"{\"v\":1}">>}
26> riakc_obj:get_content_type(X1).
** exception throw: no_metadata
in function riakc_obj:get_metadata/1
in call from riakc_obj:get_content_type/1
13> X3 = riakc_obj:new(<<"b">>, <<"k">>, <<"{\"v\":123}">>, <<"application/json">>).
{riakc_obj,<<"b">>,<<"k">>,undefined,[],
{dict,1,16,16,8,80,48,
{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],...},
{{[],[],[],[],[],[],[],[],[],[],[[<<...>>|...]],[],[],...}}},
<<"{\"v\":123}">>}
14> riakc_obj:get_update_content_type(X3).
<<"application/json">>
15> riakc_pb_socket:put(Pid, X3).
ok