Skip to content

Instantly share code, notes, and snippets.

Avatar

Kris Borchers kborchers

  • Microsoft
  • Dallas, TX
View GitHub Profile
View helpers.rb
module PDoc
module Generators
module Html
module Helpers
module BaseHelper
def content_tag(tag_name, content, attributes = {})
"<#{tag_name}#{attributes_to_html(attributes)}>#{content}</#{tag_name}>"
end
def img_tag(filename, attributes = {})
View gist:4677026
$ jekyll --server
/Users/krisborchers/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead.
Configuration from /Users/krisborchers/git-repo/aerogear.org/_config.yml
/Users/krisborchers/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- asciidoctor (LoadError)
from /Users/krisborchers/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/krisborchers/git-repo/aerogear.org/_plugins/asciidoc.rb:1:in `<top (required)>'
from /Users/krisborchers/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/krisborchers/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/krisborchers/git-repo/aerogear.org/vendor/ruby/1.9.1/gems/jekyll-0.11.2/lib/jekyll/site.rb:76:in `block in setu
View gist:4634174
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Access-Control-Request-Headers:accept, origin, content-type
Access-Control-Request-Method:GET
Connection:keep-alive
Host:corscontroller-aerogear.rhcloud.com
Origin:http://kborchers.github.com
Referer:http://kborchers.github.com/aerogear-js-integration/unit/pipeline/paging.html
View fun.js
[ "previous", "next" ].forEach( function( element ) {
data[ element ] = (function( pipe, parameters, options ) {
return function( callbacks ) {
options.paging = true;
options.offsetValue = options.limitValue = undefined;
options.query = parameters;
options.success = callbacks && callbacks.success ? callbacks.success : options.success;
options.error = callbacks && callbacks.error ? callbacks.error : options.error;
return pipe.read( options );
View gist:4564403

matzew wrote: since the pipe (or the paging request) knows whether the paging information is sent as headers, as query parameters, or as body data, it would just "serialize" the give "param provider" into the actual location.

from me: This is the part I don't understand so sorry if I'm the only one being dense here. I believe that is basically what we decided to do yesterday, but, without that initial config, how do I make the initial request for the first page? Since the callback that the dev would provide isn't triggered until a successful read so that it can "build" the next/prev methods based on the response, how do I make that first request?

View open-source.md
title
Getting Started Contributing to Open Source

Contributing to the jQuery project, and to any FOSS project for that matter, can be a rewarding experience both in terms of the way you can help yourself and projects you are working on, as well as the countless number of others you may help with your contribution. Taking that first step though, can be intimidating. From learning new technologies, to interacting with people you have never met, to putting yourself and your code out for the world to see, there are many factors that may act as barriers to entry. Hopefully, this document will give you that push you need to get past those reservations and get involved.

Dive In

Usually, someone has an idea of what they want to contribute to an open source project before they even think about how they would do it. But even if you have no idea what you want to contribute, there is probably some way that you can make your mark.

View paging-usage-comparison.md

AbstractPageRequestHandler.java

abstact class AbstractPageRequestHandler() {
    public List<Pair<String, String>>  getPagingHeaders(ReadFilter filter){
       List<Pair<String, String>> toReturn = new ArrayList<>();
       return toReturn;
    }
    
    public byte[] appendToBody(ReadFilter filter, byte[] body){
      return body;
View paging-usage-comparison.md

Below is a comparison of the method usage proposed by each lib for handling paged resources.

AG-Controller Pipe Setup

Android

iOS

View gist:4558860
I'm pulling the conversation from IRC to this thread as I'm not sure if I'm explaining my issue with offset/limit properly.
Basically, my concern is we can not choose one between offset/limit and page/perPage. The client libraries need to support both as both are popular server-side paging implementations. We also can't just use one of those names and have it work both ways since that would be confusing to developers.
My suggestion is to name these two parameters something more generic like locator/count where locator=page/offset and count=limit/perPage. Then in our configs we would provide these options:
pagingType {String} - determines the paging method to be used in calculating next page, etc. and could be either "offset" or "page", default "offset"
locatorParam {String} - locator parameter name, default "offset"
locatorValue {Number} - page index or offset
locatorIdentifier {String} - the locator identifier name, default "AG-Paging-Offset"
View changelog
This file contains a shell for the changelog, followed by a list of every commit for this release.
Choose the appropriate line for the Summary section.
Move all commit notes to the appropriate section.
- Each line should be in the following format:
[Fixed|Added]: The ticket description. ([Ticket link], [Commit link])
- If the commit is not related to a bug or feature, e.g., whitepsace cleanup, remove it.
- If there is no ticket number, search Trac for the relevant ticket.