Skip to content

Instantly share code, notes, and snippets.

View abstractj's full-sized avatar

Bruno Oliveira da Silva abstractj

View GitHub Profile
@eripa
eripa / bridge.sh
Created April 25, 2014 07:04
OS X network bridge
#! /bin/sh
# ######################################
# coded by Nat!
# 2013 Mulle kybernetiK
# GPL
command=${1:-start}
shift
proxyarp=${1:-no}
shift
<?xml version="1.0" encoding="UTF-8"?>
<!--
JBoss, Home of Professional Open Source
Copyright Red Hat, Inc., and individual contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@kborchers
kborchers / persistence-spec.md
Created July 10, 2012 15:34
Initial persistence API draft

Persistence API - draft 0.1

This is a initial proposal on having a very simple persistence layer

Requirements

  • Enable data to be created/saved/persisted/queryied/removed to/from the server side in a consistent manner without no matter the data format expected by the server

References

/* Need to add license, description, etc. */
// This will be broken into its own file to be reused
(function( window, undefined ) {
var aerogear = window.aerogear = {
};
})( this );
// AeroGear Pipeline
@danbev
danbev / gist:3305522
Created August 9, 2012 16:09
Route definitions explained

Below is how routes are defined in aerogear-controller:

Routes routes = new AbstractRoutingModule() {
    @Override
    public void configuration() {
        route()
                .from("/home")
                .on(GET)
                .to(SampleController.class).index();
 }
Request Headers
POST /todo-server/rest/task HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Content-Length: 124
Origin: http://localhost:8080
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.57 Safari/537.1
Content-Type: application/json
Accept: */*
@matzew
matzew / gist:3405912
Created August 20, 2012 17:15
AeroGear-iOS: first API draft

Basic functionality of the aerogear-ios pipeline structure - DRAFT Version 0.1

The pipeline object (AGPipeline):

/**
 * AGPipeline represents a 'collection' of server connections (pipes) and
 * their corresponding data models. This object provides a standard way to
 * communicate with the server no matter the data format or transport expected.
 * 
  • A pipeline must have at least one pipe.

AeroGear DataManager JavaScript Specification

This is a very high level overview of the DataManager spec for the AeroGear.js library. This can also be used as inspiration for the other client libraries and is open for discussion from all points of view.

AeroGear.DataManager

Similar to AeroGear.Pipeline, this is an object used as a factory for creating new DataManager objects, which at this time are being referred to as valves in an attempt to stay with the Pipeline theme but is definitely not a name that is set in stone. A new valve is based off of adapters and planned adapters for the JS lib are memory (default), session/local storage, IndexedDB and possibly Web SQL though I believe this is no longer maintained and may be unnecessary. These objects then deal only with client side data.

Methods

this.getData = function() {
return data;
};
this.setData = function( newData ) {
data = newData;
};
this.addDataRecord = function( record ) {
data.push( record );
};
this.removeDataRecord = function( record ) {
@danbev
danbev / gist:3871798
Created October 11, 2012 11:42
RestEasy Integration

RestEasy Integration with AeroGear Controller

This document is intended to describe AeroGear Controllers integration with RestEasy.

Background

Currently, the routes that AeroGear Controller can handle are "one way" in the sense that they go through AeroGear Controller are forwarded to a view, which can be populated by a data model provided by the Controller for the route in question.
For example:

route()
      .from("/customers/{id}")
 .on(RequestMethod.GET)