Skip to content

Instantly share code, notes, and snippets.


Kris Borchers kborchers

  • Microsoft
  • Dallas, TX
View GitHub Profile

Keybase proof

I hereby claim:

  • I am kborchers on github.
  • I am kborchers ( on keybase.
  • I have a public key whose fingerprint is 25F9 82B2 C8D9 9A5A 7996 696F 042B 1D5C DBBE E037

To claim this, I am signing this object:

View gist:40dd6b6a34f69450e473
<style> blockquote { border-left: none; color: inherit; } </style>



EFFECTIVE AS OF: _____________, 2014

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/
/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/ `<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/ `block in setu
View gist:4634174
Access-Control-Request-Headers:accept, origin, content-type
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 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?

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.


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;

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

AG-Controller Pipe Setup



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"