Skip to content

Instantly share code, notes, and snippets.

View secondsun's full-sized avatar
🎩
Happy Saturday!

Hoyt Summers Pittman secondsun

🎩
Happy Saturday!
View GitHub Profile

M1 - Basic revision Control, Data Model, Change Management, Server <->

Client Contract

  • We seem to be in agreement on a basic set of metadata to be kept for each object. [objectId, revision, object].
  • We should have a basic server definition which supports CRUD and keeps our revision numbers in check. This may not be a server product but just a spec that can be implemented by anything at this point.
  • We should have basic client code which keeps up with revisions, can check the server for new revisions, and alert the user if there is a
### Keybase proof
I hereby claim:
* I am secondsun on github.
* I am secondsun (https://keybase.io/secondsun) on keybase.
* I have a public key whose fingerprint is 1B8A 6FBF AF8A 1DEF 080A 7DC4 DD47 F3B3 EC56 F304
To claim this, I am signing this object:
@secondsun
secondsun / lambdas.java
Created May 14, 2014 15:00
Lambda's you so crazy
@Override
public Operation operate(final Object token, Environment env) {
final int value = verifyAndEvaluate(token, env);
switch (op) {
case ADD:
return ((nextToken, env2) -> (value + verifyAndEvaluate(nextToken, env2)));
case SUB:

#AeroGear Android 1.4

Today we have pushed to Maven Central our the AeroGear's Android library version 1.4. Major features include 1) The Authorizer framework with OAuth2 support 2) enhanced Request and Response handlers for Pipe's 3) a dedicated Push messaging module 4) updated docs and sample applications and 5) full aar support for Android Studio. See the New Feature Showcase section for more details.

Fetching is as easy as always:

Fetch with Maven

<dependency>
 org.jboss.aerogear
@secondsun
secondsun / Recipe.md
Last active August 29, 2015 14:10
Roast Recipe

Strip Roast

  • A New York Strip Roast
  • Dry Rub (recipe follows)
  • Wet Rub (recipe follows)
  1. Preheat the Oven to 450°F
  2. If you have a baking stone, place it in the oven.
  3. Trim the fat on the roast to about 1/4 to 1/2 inch.
  4. Rub the roast with the dry rub on all sides
  5. Place the roast fat side up and make deep incisions with a knife. Stab all the way to the meat.
@secondsun
secondsun / gist:4078711
Created November 15, 2012 13:40 — forked from mstruk/gist:4074544
PipeConfig Ergonomics

Currently, when creating a new PipeConfig we use a constructor and specify a rootUrl:

    URL rootUrl = new URL("http://todo-aerogear.rhcloud.com/todo-server");

    Pipeline pipeline = new Pipeline(rootUrl);
    PipeConfig config = new PipeConfig(rootUrl, Project.class);

    Pipe<Project> projects = pipeline.pipe(Project.class, config);

In Main.java

Pipeline pipeline = new Pipeline(baseEarl);
PipeConfig<Data> config = new PipeConfig<>(Data.class); //config.baseUrl is null
Pipe<Data> pipe = pipeline(config);

In Pipeline.java

package net.saga.android.orienttests;
import net.saga.android.orienttests.vo.Person;
import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery;
import com.orientechnologies.orient.object.db.OObjectDatabaseTx;
import java.util.List;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
@secondsun
secondsun / Pipe.java
Created January 11, 2013 16:13
A brainstorm for fetching MetaData results for paging from a Pipe
public interface Pipe<T> {
//snip
/**
* These methods MUST add a result to a Map so that a paging context can be looked up
*/
public List<T> read();
public List<T> readWithFilter(ReadFilter filter);

Client Paging

This document describes the client side interfaces which a developer can use to Query and Page through data obtained from remote rest services. This document describes both how to interact with the Aerogear-Controller based paging as well how to extend the libraries and APIs to support most other restful services. It is currently Java centric, but this should be fixed up in the future.

At a high level, Paging and Querying is supported though the Pipe.readWithFilter(ReadFilter, Callback) method. A ReadFilter object will set the current page, number of results perPage, and a where property. The Pipe implementation will be responsible for processing a request along with any paging data and sending the appropriate headers, data, and query parameters to the server. Once the response has been received, the Pipe implementation will provide a List of objects to the supplied callback. If this call used paging, the List will be an instance of PagedList.

PagedList will be a List of results f