<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>
-
URL
<The URL Structure (path only, no root url)>
-
Method:
(function(window,undefined){ | |
// Prepare our Variables | |
var | |
document = window.document, | |
$ = window.jQuery; | |
// Wait for Document | |
$(window).bind(function(){ | |
// Prepare Variables |
/* | |
A simple and elegant function to synchronize multiple functions that expect callback as their last parameter. | |
example: | |
sync(func1, [parms], func2, func3, func4, [parms], callback); | |
Public domain!! | |
please leave me a comment if you like it! | |
*/ |
function elementToObject(element, o) { | |
var el = $(element); | |
var o = { | |
tagName: el.tagName | |
}; | |
var i = 0; | |
for (i ; i < el.attributes.length; i++) { | |
o[el.attributes[i].name] = el.attributes[i].value; | |
} |
var fs = require("fs"); | |
var path = require("path"); | |
var rmdir = function(dir) { | |
var list = fs.readdirSync(dir); | |
for(var i = 0; i < list.length; i++) { | |
var filename = path.join(dir, list[i]); | |
var stat = fs.statSync(filename); | |
if(filename == "." || filename == "..") { |
var _ = require('underscore'), | |
SocketIOClient = require('socket.io-client'), | |
liveSocket = require('../lib/live-socket'); | |
exports.setupClient = function(opts) { | |
return function() { | |
opts = opts || {}; | |
_.defaults(opts, { | |
url: 'http://localhost:8000', | |
options: { |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.