If http://localhost/api/do_job kicks off a job on the backend that will take 45-120 seconds to complete,
what should the API return?
Eg:
202 Accepted
{ "job_id": 103859195, "poll": "http://localhost/poll/103859195", "complete": "0%" }
| <link rel="import" href="../chart-js/chart-js.html"> | |
| <polymer-element name="my-element"> | |
| <template> | |
| <style> | |
| :host { | |
| position: absolute; | |
| width: 100%; | |
| height: 100%; |
| <html> | |
| <head> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script> | |
| <!-- Download from here: http://imakewebthings.com/jquery-waypoints/ --> | |
| <script src="https://raw.githubusercontent.com/imakewebthings/jquery-waypoints/master/waypoints.js"></script> | |
| <style type="text/css"> | |
| /* A box that is 500px tall */ | |
| .content { | |
| height: 500px; |
| You have ... | |
| [1,2,3,4,5,6,7,8,9] | |
| [1,2,3,4,5,6,7] | |
| [1,2,3] | |
| You want in chunks of N (say 3) | |
| [ | |
| [1,2,3], | |
| [4,5,6], | |
| [7,8,9], |
| /** | |
| * The very simplest explanation of how GA works in JavaScript is that it's simply an array. | |
| * The GA tag (not the new Universal tag) looks similar to this: | |
| */ | |
| var _gaq = _gaq || []; | |
| _gaq.push(['_setAccount', 'UA-xxxxxxxx-y']); | |
| _gaq.push(['_trackPageview']); | |
| (function () { |
| /** | |
| * Humanize a string. Turns underscored or camel cased string into human readable strings | |
| * | |
| * @example | |
| * TextUtils.humanize( 'keyword_category' ); // => "Keyword Category" | |
| * TextUtils.humanize( 'keywordCategory' ); // => "Keyword Category" | |
| * | |
| * @return {String} | |
| */ | |
| humanize: function(str) { |
| class Puzzle | |
| attr_accessor :field | |
| def initialize | |
| self.field = true | |
| end | |
| def run | |
| puts field.inspect # => true |
| /** | |
| * Adds empty elements to an array | |
| * | |
| * @example | |
| * A1: hello | |
| * A2: world | |
| * | |
| * =splitArrayBy(A1:A2, 3) | |
| */ | |
| function splitArrayBy(array, n) { |
| function computeMD5(str) { | |
| var digest = Utilities.computeDigest(Utilities.DigestAlgorithm.MD5, str); | |
| return Utilities.base64Encode(digest); | |
| } | |
| function computeSHA1(str) { | |
| var digest = Utilities.computeDigest(Utilities.DigestAlgorithm.SHA_1, str); | |
| return Utilities.base64Encode(digest); | |
| } |
| // This is to be used as a bookmarklet | |
| // Supposed to show a prompt where you pick if you want to do a site: search alpha using 'a' or bravo using 'b' | |
| // However, this isn't working as a bookmarklet but does work in the live w3 editor | |
| javascript:var name=prompt("Please enter your name \n a = alpha \n b = bravo","x"); | |
| switch (name) { | |
| case "a": | |
| location.href='http://www.google.com/search?q=site%3A'+document.domain.replace('www.','')+" alpha" | |
| break; | |
| case "b": |