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 YUI = require('yui3').YUI; | |
YUI.GlobalConfig = { | |
groups: { | |
yi: { | |
modules: { | |
"Yi.lang": { | |
fullpath: '/Volumes/Private/johnnyluu/Projects/yi/lib/lang.js' | |
}, | |
"Yi.workflow": { |
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
history : new Y.HistoryHash(), | |
COMPONENTS : { | |
PageContentInfo : { | |
requires : ['PageContentInfo'], | |
initializer : '_initPageContentInfo' | |
}, | |
PageContentForum : { |
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
require 'yui-utils' | |
task :yui_modules do | |
output = YUIUtils.build_module_list() | |
#YUIUtils.output(modules) | |
end |
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
require 'yui-utils' | |
task :default, [:file, :replace, :filter, :jsdir] do |t, args| | |
args.with_defaults( | |
:filter => nil, | |
:jsdir => nil, | |
:replace => nil | |
) | |
modules = YUIUtils.build_module_list(args.filter, args.jsdir) |
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
// Make an HTTP request to 'get.php'. | |
Y.io('get.php', { | |
on: { | |
complete: function (id, response) { | |
var id = id, // Transaction ID. | |
data = response.responseText; // Response data. | |
// ... handle the response ... | |
} | |
} |
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> | |
<title>ValueChange Multiple Subscriptions</title> | |
</head> | |
<body> | |
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
<?php | |
$file = <<<EOF | |
attribute/tests/attribute.html | |
async-queue/tests/async-queue.html | |
cache/tests/cache.html | |
cache/tests/cacheoffline.html | |
classnamemanager/tests/classnamemanager.html | |
collection/tests/arraylist.html | |
collection/tests/collection.html |
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 buildQueryString(parameterMap) { | |
var params = []; | |
for (name in parameterMap) { | |
if (parameterMap.hasOwnProperty(name)) { | |
params.push(encodeURIComponent(name) + '=' + encodeURIComponent(parameterMap[name])); | |
} | |
} | |
return params.join('&'); |
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 count = 10, | |
http = require("http"), | |
sys = require("sys"), | |
twitter = http.createClient(80, "search.twitter.com"), | |
i, request; | |
for (i = 1; i <= count; i++) { | |
request = twitter.request("GET", "/search.json?q=crockfordfact+OR+crockfordfacts&rpp=100&page=" + i, {"host": "search.twitter.com"}); | |
request.addListener('response', function (response) { | |
var responseData = []; |
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
# remove content of script tags using Sanitize | |
require 'sanitize' | |
html = '<p>Do not<script>fail();</script> kill the <a href="/cats/42">cat</a>.</p>' | |
Sanitize.clean(html, Sanitize::Config::BASIC.merge( | |
:transformers => lambda { |env| | |
node = env[:node] | |
if node.name.downcase == 'script' |
NewerOlder