This file contains 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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<script src="http://yui.yahooapis.com/combo?3.7.2/yui-base/yui-base.js&3.7.2/loader-base/loader-base.js"></script> | |
<script> | |
YUI.add('loader-app', function (Y) { | |
YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { | |
"json-stringify":{"requires":["yui-base"]}, | |
"oop":{"requires":["yui-base"]} |
This file contains 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
YUI.add('mojito', function(Y, NAME) { | |
Y.namespace('mojito'); | |
}, '0.1.0', {requires: []}); |
This file contains 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
YUI.add("loader",function(Y){YUI.Env[Y.version].modules=YUI.Env[Y.version].modules||{"mojito":{"requires":[]},"json-stringify":{"requires":["yui-base"]},"array-extras":{"requires":["yui-base"]},"mojito-util":{"requires":["array-extras","json-stringify","mojito"]},"mojito-view-renderer":{"requires":["mojito"]},"oop":{"requires":["yui-base"]},"event-custom-base":{"requires":["oop"]},"mojito-action-context":{"requires":["mojito","json-stringify","event-custom-base","mojito-view-renderer","mojito-util"]},"mojito-resource-store-adapter":{"requires":["mojito-util","json-stringify"]},"mojito-dispatcher":{"requires":["mojito-action-context","mojito-util","mojito-resource-store-adapter"]},"querystring-parse":{"requires":["yui-base","array-extras"]},"querystring-stringify":{"requires":["yui-base"]},"mojito-mojit-proxy":{"requires":["mojito","mojito-util","querystring-parse","querystring-stringify"]},"dom-core":{"requires":["oop","features"]},"dom-base":{"requires":["dom-core"]},"selector-native":{"requires":["dom-base" |
This file contains 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
{ | |
"hello": { | |
"results": [{ | |
"passed": 1, | |
"failed": 0, | |
"total": 1, | |
"ignored": 0, | |
"duration": 12, | |
"type": "report", | |
"name": "UseCases: hello", |
This file contains 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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<script src="http://yui.yahooapis.com/combo?3.7.3/yui-base/yui-base.js&3.7.3/loader-base/loader-base.js"></script> | |
<script> | |
YUI.add('loader-app', function (Y) { | |
YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { | |
"json-stringify":{"requires":["yui-base"]}, | |
"foo":{ |
This file contains 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
[ | |
{ | |
"settings": [ "master" ], | |
"appPort": 80, | |
"staticHandling": { | |
"cache": true | |
}, | |
"yui": { | |
"config": { | |
"combine": true, |
This file contains 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
var Y = require('yui/json'), | |
microtime = require('microtime'), | |
i, | |
t, | |
obj = { | |
foo: { | |
bar: { | |
baz: 'token' | |
} | |
} |
This file contains 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
var microtime = require('microtime'), | |
i, | |
t, | |
obj, | |
max = 10000000; | |
function run1(obj) { | |
t = microtime.now(); | |
for (i = 0; i < max; i += 1) { | |
if (obj.foo) obj.foo(); |
This file contains 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
NodeJS 0.8.x on MBP: | |
$ node delete.js | |
89300 'value to null' | |
3100674 'deleting member' |
This file contains 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 modified(req, headers) { | |
var modifiedSince = req.headers['if-modified-since'], | |
lastModified = headers['Last-Modified'], | |
noneMatch = req.headers['if-none-match'], | |
etag = headers.ETag, | |
etagModified = true, | |
dateModified = true; | |
// Check If-None-Match | |
if (noneMatch && etag && noneMatch === etag) { | |
etagModified = false; |