View answer.js
/**
* To answer @AnnieCushing's question on Twitter:
* https://twitter.com/AnnieCushing/status/806518054368739329
*
* Author: Chris Le - @iamchrisle
*
* There's a few ways to do this.
* - Like @SimoAhava suggested, server redirects that strips parameters if you
* have the ability to control the server.
View scraper.js
/**
* Install x-ray with: 'npm install x-ray'
* (Also see: https://github.com/lapwinglabs/x-ray)
*
* Run with: node scraper.js
*
* Result:
*
* [ { rankCurrent: '1',
* rankLast: 'Last Week: 1',
View designer.html
<link rel="import" href="../chart-js/chart-js.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
View scrollwaypoints.html
<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;
View gist:9478860
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],
View gist:8588282
/**
* 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 () {
View gist:7055839

Question

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?

POLL) Return 202 Accepted + a URL polling end point.

Eg:

202 Accepted
{ "job_id": 103859195, "poll": "http://localhost/poll/103859195", "complete": "0%" }
View gist:6368604
/**
* 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) {
View gist:5774203
class Puzzle
attr_accessor :field
def initialize
self.field = true
end
def run
puts field.inspect # => true
View gist:5129460
/**
* Adds empty elements to an array
*
* @example
* A1: hello
* A2: world
*
* =splitArrayBy(A1:A2, 3)
*/
function splitArrayBy(array, n) {