Skip to content

Instantly share code, notes, and snippets.

View dreverri's full-sized avatar

Daniel Reverri dreverri

View GitHub Profile
<?php
$dictionary['moduleName']['unified_search'] = true; // opts module in
$dictionary['moduleName']['fields'][fieldName]['unified_search'] = true; // opts field in
?>
def is_perm(ss,s):
for l in ss:
if s.find(l) != -1:
s = s.replace(l,"",1)
else:
return False
return True
if __name__ == "__main__":
lines = [
class MyWorld
include Rack::Test::Methods
include Webrat::Methods
include Webrat::Matchers
def app
App
end
end
lists:foldl(fun(F, Acc) ->
case file:open(F, [read, raw, binary]) of
{ok, Io} ->
file:close(Io),
Acc;
{error, Reason} ->
[[{file, F},{error, Reason}]|Acc]
end
end,
[],
Fun = fun(Nodes) ->
{ok, LocalRing} = riak_core_ring_manager:get_my_ring(),
LocalOwners = riak_core_ring:all_owners(LocalRing),
case (catch lists:foldl(fun(Node, _) ->
{ok, R} = rpc:call(Node, riak_core_ring_manager, get_my_ring, []),
true = riak_core_ring:all_owners(R) =:= LocalOwners
end,
true,
Nodes)) of
true -> true;
// log the structure of the value passed to the function
precommitHook: function(value) {
ejsLog("log/js.log", value.toSource());
return value;
}
{sys, [
{lib_dirs, []},
{rel, "mysample", "1",
[
kernel,
stdlib,
sasl
]},
{rel, "start_clean", "",
[
import sys
from riak import RiakClient
from riak import RiakPbcTransport
ip = '127.0.0.1'
port = 8087
def store_file(filename):
with open(filename, 'r') as f:
data = f.read()
@dreverri
dreverri / gist:1027829
Created June 15, 2011 19:02
Remove 0 byte files
find data/bitcask -size 0 -print0 | xargs -0 rm
Vagrant::Config.run do |config|
(1..1).each do |index|
config.vm.define "riak#{index}".to_sym do |cfg|
ip = "33.33.33.1#{index}"
cfg.vm.box_url = "http://files.vagrantup.com/lucid32.box"
cfg.vm.box = "lucid32"
cfg.vm.network(ip)
cfg.vm.forward_port("ssh", 22, "222#{index}".to_i)
cfg.vm.customize do |vm|
vm.name = "riak#{index}"