This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Sample usage of the PostView. | |
| * Note, this example assumes that the model is used outside of a collection | |
| * and the post content contains elements with a data-gistId attribute. | |
| * For example: | |
| * <code data-gistId='12345'></code> | |
| */ | |
| require.config({/* The configuration needed for your app to work with RequireJS. */}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Standalone server | |
| require('restbus').listen(3000, function() { | |
| console.log('restbus is now listening on port 3000'); | |
| }); | |
| // Embedded | |
| var app = require('express'); | |
| var restbus = require('restbus'); | |
| // (As express middleware) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "status": 404, | |
| "statusDesc": "Not Found", | |
| "message": "The requested URI can not be found on this server." | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| // ... some resource's JSON representation ... | |
| _links: { | |
| /** | |
| * EVERY resource links to its own canonical representation which may | |
| * or may not be located at the current context URI, i.e. depending on | |
| * the current context, an actual state transition might or might not | |
| * occur when dereferencing the link. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| // ... San Francisco Muni agency resource ... | |
| _links: { | |
| self: { | |
| href: "http://localhost:3535/agencies/sf-muni", | |
| type: "application/json", | |
| rel: "self", | |
| rt: "agency", | |
| title: "Transit agency 'sf-muni'." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Standalone | |
| var socoapi = require('socoapi'); | |
| socoapi.listen('3535', 3600000, function() { | |
| console.log('socoapi listening on port 3535'); | |
| }); | |
| // Embedded | |
| var app = require('express')() | |
| , socoapi = require('socoapi') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "facebook" : 1434, | |
| "google" : 517, | |
| "pinterest": 160, | |
| "url" : "http//www.foobar.baz/?q1=v1&q2=v2" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NameVirtualHost *:80 | |
| <VirtualHost *:80> | |
| ServerName myapp | |
| DocumentRoot /path/to/myapp/doc/root | |
| ProxyPreserveHost On | |
| ProxyPass /socoapi http://127.0.0.1:3535 | |
| ProxyPass / http://127.0.0.1:3000/ | |
| ProxyPassReverse / http://127.0.0.1:3000/ | |
| ProxyPassReverse /socoapi http://127.0.0.1:3535 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| connectEnd: 318.862000000081 | |
| connectStart: 318.862000000081 | |
| domainLookupEnd: 318.862000000081 | |
| domainLookupStart: 318.862000000081 | |
| duration: 53.30899999989924 | |
| entryType: "resource" | |
| fetchStart: 318.862000000081 | |
| initiatorType: "link" | |
| name: "http://www.foobar.com/blog/wp-content/themes/foobar/style.css" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getJSONResourceHierachy() { | |
| var images = {png: 1, jpg: 1, jpeg: 1, gif: 1, tif: 1, tiff: 1, bmp: 1, ico: 1, svg: 1} | |
| , entries = window.performance.getEntriesByType('resource') | |
| , length = entries.length | |
| , archy = {} | |
| , entry = undefined | |
| , name = undefined | |
| , mt = undefined | |
| ; | |