I hereby claim:
- I am chrhicks on github.
- I am chrhicks (https://keybase.io/chrhicks) on keybase.
- I have a public key ASAnqvN5GeqpzwIjh1pecA0pEk1o-W1OpssD7UxmUQdjQgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| { | |
| "id": 4684773897, | |
| "lines": [ | |
| { | |
| "variant_id": 6056723589, | |
| "quantity": 1, | |
| "price": { | |
| "name": "Price", | |
| "amount": 135, | |
| "cents": 13500, |
| var request = require('request'); | |
| /** | |
| * ## Responses | |
| * Responses from this API with be wrapped in an envelope to assist the caller | |
| * in dealing with the various responses from the service. There are no types | |
| * to check against in JavaScript, so this facilitates that. | |
| * | |
| * { | |
| * status: 200, |
| <p>Given any integer print an English phrase that describes the integer. (e.g. "One Thousand, Three Hundred Twenty Four").</p> | |
| <div id="log"></div> |
| object ProgramHelper { | |
| def filter(node: Node)(implicit filterFn: Node => Boolean): List[Node] = { | |
| (if (filterFn(node)) List(node) else List()) ++ (node match { | |
| case n:Path => n.value.flatMap(filter(_)) | |
| case n:Partial => filter(n.value) | |
| case n:Mustache => filter(n.value) ++ n.parameters.flatMap(filter(_)) | |
| case n:Section => filter(n.name) ++ filter(n.value) | |
| case n:Program => n.value.flatMap(filter(_)) ++ n.inverse.map(filter(_)).getOrElse(List()) | |
| case _ => List() | |
| }) |
| object HandlebarsHelper { | |
| def apply(baseuri: String): HandlebarsHelper = new HandlebarsHelper(baseuri) | |
| } | |
| class HandlebarsHelper(baseuri: String) extends Loggable { | |
| val EXTENSION = ".handlebars" | |
| def fromFile(fileName: String): Handlebars = | |
| Handlebars(parse(getFileContents(baseuri + "/" + fileName).getOrElse(""))) |
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |