Skip to content

Instantly share code, notes, and snippets.

View andytill's full-sized avatar

Andy Till andytill

View GitHub Profile
@andytill
andytill / Time Series Usage.md
Last active September 22, 2015 17:01
Time Series Usage

Create bucket type with the table_def property.

export TAB=GeoCheckin; dev/dev1/bin/riak-admin bucket-type create $TAB "{\"props\":{ \"table_def\": \"CREATE TABLE GeoCheckin (geohash varchar not null, user varchar not null, time timestamp not null, weather varchar not null, temperature varchar, PRIMARY KEY((quantum(time, 15, s)), time, user))\"}}"

Activate it:

dev/dev1/bin/riak-admin bucket-type activate $TAB

@andytill
andytill / riak util scripts.sh
Created September 22, 2015 17:14
riak util scripts.sh
## start_cluster.sh
for node in {1..3}; do dev/dev$node/bin/riak start; done
## cluster_up.sh (clusters the individualnodes)
for node in {2..3}; do dev/dev$node/bin/riak-admin cluster join 'dev1@127.0.0.1'; done
@andytill
andytill / makecheckk
Created October 1, 2015 08:10
makecheckk
make -C test LEGACY=
make[1]: Entering directory `/home/vagrant/work/erlang.mk/test'
build: Generate a bleeding edge Erlang.mk
core-app-asn1: Bootstrap a new OTP library named core_app_asn1
core-app-asn1: Download .asn1 files from Erlang/OTP
core-app-asn1: Generate .erl files dependent from headers generated by .asn1 files
core-app-asn1: Generate an unrelated .hrl file
core-app-asn1: Build the application
core-app-asn1: Check that all compiled files exist
core-app-asn1: Check that the application was compiled correctly
gist test
@andytill
andytill / ListBuilderController.java
Created July 29, 2012 19:24
JavaFX controller implementing IdentifiableController
import javafx.fxml.FXML;
import javafx.scene.Parent;
@FXMLLoadingScoped
public class ListBuilderController<T> implements IdentifiableController {
@FXML
private Parent root;
@andytill
andytill / embedListBuilder.fxml
Created July 29, 2012 19:44
AnchorPane with embedded FXML control, in this case ListBuilder.fxml
<AnchorPane fx:id="factorsList" minHeight="138.0" prefHeight="138.0" prefWidth="418.0">
<children>
<fx:include source="listBuilder.fxml" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
</children>
<VBox.margin>
<Insets left="2.0" right="2.0" />
</VBox.margin>
</AnchorPane>
public interface IdentifiableController {
String getId();
}
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
public class FXMLLoadingModule extends AbstractModule {
private final FXMLLoadingScope fxmlLoadingScope;
public FXMLLoadingModule() {
fxmlLoadingScope = new FXMLLoadingScope();
}
import java.util.List;
public class ControllerLookup {
private final List<IdentifiableController> identifiables;
public ControllerLookup(List<IdentifiableController> identifiables) {
this.identifiables = identifiables;
}
@SuppressWarnings("unchecked")
package projmon.guice;
import java.util.ArrayList;
import com.google.inject.Key;
import com.google.inject.Provider;
import com.google.inject.Singleton;
@Singleton
public class FXMLLoadingScope extends EnterableScope {