Skip to content

Instantly share code, notes, and snippets.

@browser = Selenium::Client::Driver.new \
:host => "localhost",
:port => 4444,
:browser => "*firefox",
:url => "http://www.google.com",
:timeout_in_second => 60
@browser.start_new_browser_session
@browser.open "/"
@browser.type "q", "Ruby Tuesday #11"
@@asset_timestamps_cache = {}
@@asset_timestamps_cache_guard = Mutex.new
# Use the RAILS_ASSET_ID environment variable or the source's
# modification time as its cache-busting asset id.
def rails_asset_id(source)
if asset_id = ENV["RAILS_ASSET_ID"]
asset_id
else
<ul>
<li>AAA</li>
<div class="foo">
<li class="bar">BBBB</li>
</div>
</ul>
<li class="categories">
<div class="col">
<label class="desc">日記分類</label>
<select>
<option>----------請選擇一個分類----------</option>
<option>滿月</option>
<option>第一次不依靠攙扶會自己行走</option>
<option>幼稚園開學</option>
<option>百日禮</option>
<option>收涎</option>
<li class="categories">
<label class="desc">日記分類</label>
<div class="col">
<select>
<option>----------請選擇一個分類----------</option>
<option>滿月</option>
<option>第一次不依靠攙扶會自己行走</option>
<option>幼稚園開學</option>
<option>百日禮</option>
<key>NSUIElement</key>
<string>1</string>
<key>Java</key>
<dict>
<key>StartOnMainThread</key>
<string>true</string>
</dict>
var img = new Image();
$(img).load(function(){
alert('onload)
});
img.src = 'demo.jpg';
#
# Returns a string which represents the time as dateTime defined by XML
# Schema:
#
# CCYY-MM-DDThh:mm:ssTZD
# CCYY-MM-DDThh:mm:ss.sssTZD
#
# where TZD is Z or [+-]hh:mm.
#
# If self is a UTC time, Z is used as TZD. [+-]hh:mm is used otherwise.
a=Time.now.to_f
require 'stringio'
puts Time.now.to_f - a
require 'thread'
puts Time.now.to_f - a
require "open-uri"
puts Time.now.to_f - a
require "yaml"
puts Time.now.to_f - a
<!doctype html>
<html>
<head>
<style>
<!--
body {
text-align: center;
}
#doc {