Skip to content

Instantly share code, notes, and snippets.

$ 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
@slfritchie
slfritchie / presentation.md
Created March 18, 2014 09:22
Erlang tracing, for the Riak source code reading series, 2014-03-18, Tokyo, Japan

Erlang Tracing: more than you wanted to know

Rough Outline

  • What can be traced?
  • How can trace events be specified?
  • "match specifications": twisty passages, all alike
  • WTF, can I just use DTrace and drink my coffee/beer/whisky in peace?
  • Trace delivery mechanisms: pick one of two

Riak local client

Riak local client is what you want to read from or write to Riak while running riak attach, and Erlang MapReduce job, or a post_commit hook.

Examples of using Riak local client

11: {ok,Client} = riak:local_client()

-> {ok,{riak_client,['dev1@127.0.0.1',undefined]}}

@sdebnath
sdebnath / gist:36c235e042cb35db7d1f
Last active July 13, 2018 09:39
Add field to Riak YZ Schema with CRDTs
This gist captures what needs to be done to add a new field to Riak's Yokozuna
search index.
Sources:
- https://github.com/basho/yokozuna/issues/130
- http://riak-users.197444.n3.nabble.com/How-to-update-existed-schema-td4032143.html
The code below is for illustration purposes only. Use at your own risk.
1. Create/Update new schema file
@binarytemple
binarytemple / tanodb-preflist.markdown
Last active January 23, 2018 12:33 — forked from angrycub/preflist.erl
Testing tanodb preflist generation

tanodb is a distributed in memory key value store built on top of riak_core.

It is used as the example code for the Little Riak Core Book.

(kudos to @cv for the original version)

I found the following piece of code in a gist, but when I tried to execute it under taminodb, it returned an empty array.

@flbuddymooreiv
flbuddymooreiv / readme.md
Last active February 6, 2024 22:31
erlang + rebar + cowboy Hello World

This is the process of setting up erlang, rebar3, and cowboy for a Hello World, starting with a clean Debian 8 install.

Update apt and install deps:

root@046edcaea45a:~# apt-get update
root@046edcaea45a:~# apt-get install erlang erlang-dev gcc
root@046edcaea45a:~# wget https://s3.amazonaws.com/rebar3/rebar3
root@046edcaea45a:~# mkdir ~/bin/
root@046edcaea45a:~# mv rebar3 ~/bin/
root@046edcaea45a:~# chmod +x ~/bin/rebar3 
@QuantumGhost
QuantumGhost / example.puml
Last active March 23, 2024 22:39
A simple template for PlantUML to draw ER diagram.The basic idea comes from http://plantuml.sourceforge.net/qa/?qa=331/database-modeling
@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>
@binarytemple
binarytemple / utility.md
Last active April 29, 2020 10:34
Erlang decompiler I found on the web, works for Elixir beam files too

DON'T BOTHER USING - BROKE CODE

%% Author: PCHAPIER
%% Created: 25 mai 2010
-module(utility).

%%
%% Include files
%%
@magnetikonline
magnetikonline / README.md
Last active June 22, 2024 06:03
List all Git repository objects by size.

List all Git repository objects by size

Summary

Bash script which will:

  • Iterate all commits made within a Git repository.
@bryanhuntesl
bryanhuntesl / YOKOZUNA.md
Last active February 6, 2018 13:18 — forked from drewkerrigan/YOKOZUNA.md
Yokozuna Setup

Create a schema based on the default one

curl "https://raw.githubusercontent.com/basho/yokozuna/develop/priv/default_schema.xml" -O
vim default_schema.xml

Upload your schema