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
/** | |
* This is an example Wiki web application written on Pintura | |
*/ | |
var pageFacets = require("./facet/page"), | |
pageChangeFacets = require("./facet/page-change"), | |
admins = require("commonjs-utils/settings").security.admins, | |
fullModel = require("./model/index"), | |
Package = require("perstore/model").Package, | |
copy = require("commonjs-utils/copy").copy, | |
Register = require("pintura/security").Register; |
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
var request = require("rhino-http-client").request; | |
var r = request({url:"http://www.google.com"}); | |
r.then(function(r){ | |
print("status: " + r.status); | |
r.body.forEach(function(){ | |
print("part") | |
}).then(function(){ | |
print("done"); | |
}) | |
}); |
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
node>when = require("promised-io/promise").when; | |
[Function] | |
node>defer = require("promised-io/promise").defer; | |
[Function] | |
node>d = defer(); | |
node>when(when(d.promise,function(){},function(){return 5}),function(){print("su | |
ccess");}); | |
{ then: [Function] } | |
node>d.reject("error"); |
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
dojo.provide("dojo.socket"); | |
dojo.socket = function(/*dojo.__XhrArgs*/ argsOrUrl){ | |
// summary: | |
// Provides a simple socket connection using WebSocket or long-polling based | |
// communication in legacy browsers for comet-style communication. This is based | |
// on the WebSocket API and returns an object that implements the WebSocket interface: | |
// http://dev.w3.org/html5/websockets/#websocket | |
// argsOrUrl: | |
// This uses the same arguments as the other I/O functions in Dojo, or a |
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
require.def("uses-foo",["has!node:./node/foo,svg:./svg/foo,./default/foo"],function(foo){ | |
foo.bar(); | |
}); |
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
var currentModule, defaultCompile = module.constructor.prototype._compile; | |
module.constructor.prototype._compile = function(content, filename){ | |
currentModule = this; | |
try{ | |
return defaultCompile.call(this, content, filename); | |
} | |
finally { | |
currentModule = null; | |
} | |
}; |
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
db = new Storage # external implementation | |
Store = (entity) -> | |
find: db.find.bind db, entity | |
get: db.get.bind db, entity | |
save: db.save.bind db, entity | |
add: db.insert.bind db, entity | |
remove: db.remove.bind db, entity | |
update: db.update.bind db, entity | |
patch: db.patch.bind db, entity |
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
{ | |
"cars": [ | |
{"make": "Honda", "model": "Accord"}, | |
{"make": "Ford", "model": "Taurus"}, | |
] | |
} |
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
[{"match":"/BlackBerry.+AppleWebKit\\/([\\d\\.]+)/","name":"BlackBerry","version":400,"has":{"activex":false,"activex-enabled":false,"array-es5":true,"array-every":true,"array-filter":true,"array-foreach":true,"array-indexof":true,"array-isarray":true,"array-lastindexof":true,"array-map":true,"array-reduce":true,"array-reduceright":true,"array-slice-nodelist":true,"array-some":true,"audio":true,"audio-m4a":true,"audio-mp3":true,"audio-ogg":true,"audio-wav":true,"bug-arguments-instanceof-array":false,"bug-array-concat-arguments":false,"bug-bgimagecache":true,"bug-computed-style-hidden-zero-height":false,"bug-computed-values-for-static":false,"bug-contains":false,"bug-dontenum-enumerable":false,"bug-es5-regexp":true,"bug-es5-trim":true,"bug-function-expression":false,"bug-getelementbyid-ids-names":false,"bug-getelementbyid-ignores-case":false,"bug-getelementsbyname":false,"bug-getelementsbytagname-returns-comment-nodes":false,"bug-offset-values-positioned-inside-static":false,"bug-overflow-style":false,"bug-pre |
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
HTTP/1.1 200 OK | |
Content-Type: application/foo+json; # Web applications typically do and should use JSON as the semantic data source | |
# If your mobile device has an app for "application/foo+json", auto-launch app to handle resource | |
Link: <http://foo.com/ui.html>; rel="renderer" # HTML page to use to renderer it | |
Link: <http://foo.com/ui.ipa>; rel="ios.renderer" # Recommended device-specific app for this resource | |
Link: <http://foo.com/schema>; rel="describedby" # schema describing the JSON structure so that search engines can crawl it | |
... |