Skip to content

Instantly share code, notes, and snippets.

@v6ak
Created June 22, 2014 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save v6ak/b3426f858b12723334fa to your computer and use it in GitHub Desktop.
Save v6ak/b3426f858b12723334fa to your computer and use it in GitHub Desktop.
// An ugly hack for Bittorrent sync; hope to write more later
// separate function for easier debugging
show = function(x){console.log(["X:"+x.folders.map(function(x){return {folder: x, active_peers: x.peers.filter(function(peer){return peer.down_diff || peer.up_diff;})};}).filter(function(x){return x.active_peers.length > 0;}).map(function(x){return x.folder.name;})])}
var origRequest = utWebUI.request; utWebUI.request= function(a, e, d, b){return origRequest.call(this, a, function(f){e && e(f); console.log(f.folders);}, d, b); };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment