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
module Thoth | |
class MainController | |
after(:index) do | |
@page = Page[:name => 'front'] | |
@show_page_edit = true | |
end | |
end | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
// Shaving off even more characters, because I can | |
function L(U,C){var d=document,f='firstChild',r='readyState',h=d.documentElement[f],s=d.createElement('script'),m=s[r]?'onreadystatechange':0;s.src=U;s[m||'onload']=function(){if(!m||/ded|te/.test(s[r])){s[m]=null;C()}};h.insertBefore(s,h[f]);} | |
// async loading of javascript files, starting asap. | |
L("http://example.com/example.js",function () { | |
doSomething(); |
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' |
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
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
<?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
<!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
// 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
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
require 'yui-utils' | |
task :yui_modules do | |
output = YUIUtils.build_module_list() | |
#YUIUtils.output(modules) | |
end |
OlderNewer