Skip to content

Instantly share code, notes, and snippets.

View kellymclaughlin's full-sized avatar
🏠
Working from home

Kelly McLaughlin kellymclaughlin

🏠
Working from home
View GitHub Profile
@kellymclaughlin
kellymclaughlin / Cargo.toml
Last active May 10, 2018 15:34
program to compare transaction-batched postgres inserts versus insert-per-transaction inserts
name = "pg-test"
version = "0.1.0"
authors = ["Kelly McLaughlin <kelly.mclaughlin@joyent.com>"]
[dependencies]
postgres = {version = "0.15.2", features=["with-uuid"]}
uuid = { version = "0.5", features = ["v4"] }
#!/usr/sbin/dtrace -qs
/*
* USAGE : pgwrites.d
*
* DESCRIPTION:
* Count buffer and wal dirty writes over time
*
*/
@kellymclaughlin
kellymclaughlin / haskell-smartos.md
Last active January 26, 2019 17:33
GHC build steps for Haskell on SmartOS

I borrowed these steps from the buildbot setup for SmartOS I found at http://haskell.inf.elte.hu/builders/. Generally the standard build steps for ghc seems to work pretty well at this point aside from a few more test failures than I observed when building on Linux.

  1. Clone ghc repo and check out desired branch or tag.
  2. Edit mk/build.mk to be the following:
{-- This instance does a lot with a small amount of code so this is a
short explanation of what is going on. Once we know we have a JSON
Object the next thing to determine before more parsing is the type of
event we are dealing with. To determine this we use some handy Lens
helpers for dealing with JSON from Data.Aeson.Lens to traverse the
document to where the type should be and return a `Maybe Text`. We can
then pass this result right to the `toEventType` function using the
Monad bind operator. If all goes well we now have the information to
proceed with parsing the event and if something has gone wrong we have
`Nothing`. We use `fmap` to apply `parseJSON v` to the `eventType`
diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el
index c56759e..16b054f 100644
--- a/lib/tools/emacs/erlang.el
+++ b/lib/tools/emacs/erlang.el
@@ -5426,14 +5426,16 @@ unless the optional NO-DISPLAY is non-nil."
(defun inferior-erlang-compile-outdir ()
"Return the directory to compile the current buffer into."
(let* ((buffer-dir (directory-file-name
- (file-name-directory (erlang-local-buffer-file-name))))
- (parent-dir (directory-file-name
22:19:52:rebar3(config-option-merging-tweak) $ glogp -n 1 && rebar ct suites=rebar_release
ce8530b7b61f38b4a49a7c412791b1ba09e32ee6 Test cases to exercise the dev_mode release option
==> rebar3 (ct)
DONE.
Testing repos.rebar3.rebar_release_SUITE: TEST COMPLETE, 4 ok, 0 failed of 4 test cases
{profiles, [
{default, []},
{prod, [
{relx, [{dev_mode, false}]}
]},
{test, [
{eunit_compile_opts, [debug_info]}
]}
]}.
09:00:35:(feature/rebar-profiles *) $ ./rebar3 wtf as test eunit
===> ProviderName: wtf
Rebar3 wtf report
version 3.0.0-alpha
generated at 2015-03-10T15:01:52+00:00
=================
Please submit this along with your issue at https://github.com/rebar/rebar3/issues (and feel free to edit out private information, if any)
-----------------
Task: astesteunit
Entered as:
===> Consult config file "rebar.config"
===> Consult config file "rebar.lock"
===> Verifying dependencies...
===> Bad packages index, try to fix with `rebar3 update`
===> Consult config file "/home/kelly/XXX/repos/myapp/_build/lib/ranch/rebar.config"
===> Consult config file "/home/kelly/XXX/repos/myapp/_build/lib/ranch/rebar.lock"
===> Consult config file "/home/kelly/XXX/repos/myapp/_build/lib/procket/rebar.config"
===> Consult config file "/home/kelly/XXX/repos/myapp/_build/lib/procket/rebar.lock"
===> Consult config file "/home/kelly/XXX/repos/myapp/_build/lib/lager/rebar.config"
===> Consult config file "/home/kelly/XXX/repos/myapp/_build/lib/lager/rebar.lock"
@kellymclaughlin
kellymclaughlin / console.md
Last active August 29, 2015 14:05
Effects on Riak key listings when reducing n_val from 3 to 2
(riak@127.0.0.1)3> [C:put(riak_object:new(<<"bucket">>, list_to_binary(integer_to_list(X)), <<"val">>)) || X <- lists:seq(1,100)].
(riak@127.0.0.1)5> Props = riak_core_bucket:get_bucket(<<"bucket">>).
[{name,<<"bucket">>},
 {allow_mult,true},
 {basic_quorum,false},
 {big_vclock,50},
 {chash_keyfun,{riak_core_util,chash_std_keyfun}},
 {dw,quorum},
 {last_write_wins,false},