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
/** | |
* Aspects for js (Function call interception) | |
* Released under the MIT License | |
* @copyright 2009 Vladimir Kolesnikov | |
* @author Vladimir Kolesnikov <[email protected]> | |
*/ | |
var Aspect = new function() { | |
this.add = function(obj, aspectName, aspect) { |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<title>Aspect test</title> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
<script src="../lib/prototype.js" type="text/javascript"></script> | |
<script src="../lib/aspect.js" type="text/javascript"></script> | |
<style type="text/css" media="screen"> | |
.x |
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
ruby -e "require 'webrick';s=WEBrick::HTTPServer.new :Port=>3001,:DocumentRoot=>Dir.pwd;trap('INT'){s.shutdown};s.start" |
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
def generate_file_files | |
debug_msg "Generating file documentation in #@outputdir" | |
templatefile = @template_dir + 'file.rhtml' | |
@files.each do |file| | |
outfile = @outputdir + file.path | |
debug_msg " working on %s (%s)" % [ file.full_name, outfile ] | |
rel_prefix = @outputdir.relative_path_from( outfile.dirname ) | |
debug_msg " rendering #{outfile}" |
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
./configure --with-ruby --with-amqp --with-ruby-headersdir=/opt/local/include/ruby1.9-1.9.1/ruby --prefix=/opt/local/ |
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 'rubygems' | |
require 'eventmachine' | |
require 'em/buftok' | |
require 'base64' | |
class TwitterRealtimeJSON < EventMachine::Connection | |
MAX_LINE_LENGTH = 16*1024 | |
attr_accessor :code | |
attr_accessor :headers |
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
# Moved JSONStream to a separate project. | |
# See: http://github.com/voloko/twitter-stream | |
# or simply sudo gem install twitter-stream -s http://gemcutter.org | |
require 'rubygems' | |
require 'twitter/json_stream' | |
EventMachine::run { | |
stream = Twitter::JSONStream.connect( | |
:path => '/1/statuses/filter.json', |
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
get '/delay/:n' do |n| | |
EM.add_timer(n) do | |
async_write ["{a:'delayed for #{n} seconds'}"] | |
async_finish | |
end | |
response.headers['Content-Type'] = 'application/x-javascript' | |
async_start | |
end |
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
uki.view.NativeSelect = uki.newClass(uki.view.Base, new function() { | |
var Base = uki.view.Base.prototype, | |
proto = this, emptySelectSize = {}; | |
proto.typeName = function() { return 'uki.view.NativeSelect'; }; | |
proto._createDom = function() { | |
this._dom = uki.createElement('select', Base.defaultCss); | |
}; |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
<head> | |
<title> Drag and Drop</title> | |
</head> | |
<body> | |
<style>body, html { margin: 0; padding: 0; };</style> | |
<div id="draggable" draggable="true" unselectable="unselectable" | |
style="position:absolute;left:600px;top:50px;width:100px;height:100px; | |
line-height:100px;font-size:18px;background:#CCF;font-family:sans-serif; |