Skip to content

Instantly share code, notes, and snippets.

View lucperkins's full-sized avatar
🎯
Focusing

Luc Perkins lucperkins

🎯
Focusing
View GitHub Profile
Here is the master list of all currently available `riak.conf` params:
### Homeless
retry_put_coordinator_failure
metadata_cache_size
### Search
search.root_dir

Proposed new docs

Topic Y or N Assignee
Rolling restart
package basho.riak;
import com.basho.riak.client.RiakClient;
import com.basho.riak.client.operations.FetchDatatype;
import com.basho.riak.client.operations.FetchSet;
import com.basho.riak.client.operations.UpdateSet;
import com.basho.riak.client.operations.datatypes.SetUpdate;
import com.basho.riak.client.operations.indexes.BinIndexQuery;
import com.basho.riak.client.operations.kv.DeleteValue;
import com.basho.riak.client.operations.kv.FetchValue;

Future Developer-oriented Docs

  • Constructing Riak DAOs
  • Using Riak as a CR system (for immutable data)
  • SQL migration
  • Column store
  • Document store
@lucperkins
lucperkins / learning-scala.md
Last active August 29, 2015 14:05
Feedback on Learning Scala (for Jason Swartz)

Learning Scala Feedback

Chapter 1

  • Instructions to install Java 7 followed by a java -version command that yields Java 8 is a bit odd. I'd recommend providing sample output for Java 7 instead.
  • Might be a good idea to provide example commands for installing via Homebrew, yum, apt-get, etc.
  • For code snippets inside of paragraphs, it's always helpful IMHO to distinguish the code bits from the ordinary language bits. /usr/local in the middle of a paragraph always comes across as more clear than /usr/local.
  • You should also provide instructions on adding directories to PATH, restarting the shell, and checking to make sure that the directory has been added, i.e. echo $PATH. I know that's super basic stuff, but the install guide should be the most dumbed down part of the book. Experienced users will know to skip over this.
  • I see later on, on page 5, that "println()" is in a code-specific font, as it should be. Make sure to keep this consistent. I see this pop up in a vari
import com.basho.riak.client.api.RiakClient;
import com.basho.riak.client.api.commands.kv.FetchValue;
import com.basho.riak.client.core.query.Location;
import com.basho.riak.client.core.query.Namespace;
import com.google.common.base.Optional;
import java.util.concurrent.ExecutionException;
public class RiakDAO<T> {
private final RiakClient client;
public class Foo {
String word;
public Foo(String word) {
this.word = word;
}
}
public class FooUpdate extends Update<Foo> {
private Foo newFoo;
@lucperkins
lucperkins / ConflictResolution.java
Last active August 29, 2015 14:06
Conflict resolution example
public class Person {
private String name;
private int age;
public Person() {}
public Person(String name, int age) {
this.name = name;
this.age = age;
}
@lucperkins
lucperkins / objectMerge.js
Last active December 29, 2015 14:29
Is this really the only way to do this???
var object1 = { firstName: 'Luc', lastName: 'Perkins' };
var object2 = { age: 31, hobbies: ['singing', 'guitar', 'history', 'philosophy', 'programming']};
for (key in object2) {
object1[key] = object2[key];
}
// The result
{ firstName: 'Luc',
lastName: 'Perkins',
@lucperkins
lucperkins / compatible_json.dart
Last active December 30, 2015 20:19
I was looking for a good way to make sure that an object is properly constructed on the basis of a `fromJson` method. The only way to ensure this is to first ensure that the JSON object from which the object is being constructed has the same keys as required by the object's class. I've chosen to do this by constructing an abstract `CompatibleWit…
import 'dart:convert';
abstract class CompatibleJson {
Map<String, dynamic> get attributes;
bool jsonCompatible(Map<String, dynamic> json) {
return (json.keys.length == attributes.keys.length) &&
(json.keys.every((String key) => key.runtimeType == String)) &&
(json.keys.every((String key) => attributes.keys.contains(key)) &&
(json.values.every((dynamic value) => attributes.values.runtimeType == value.runtimeType));