#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
require 'cgi' | |
cgi = CGI.new('html3') | |
time = Time.now | |
year = time.year | |
month = time.month | |
url = "http://Gyazz.com/masui/予定表 #{year}-#{month}" |
def int(x) | |
x.to_i | |
end | |
def frac(x) | |
x.to_f - int(x) | |
end | |
def ts(x) | |
"#{x.to_i}時#{frac(x)*60.0}分" |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>title</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
</head> | |
<body> | |
<img id="img" src="http://gyazo.com/892d6b42a6a6db62ec368f90f0952984.png"> | |
<script> |
main(){ | |
printf("hello"); | |
} |
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'gyazz' | |
title = ARGV[0] | |
if !title then | |
puts "% memo title" | |
exit | |
end |
require 'rubygems' | |
require 'logger' | |
require 'active_record' | |
# ActiveRecord::Base.logger = Logger.new(STDERR) | |
# ActiveRecord::Base.colorize_logging = false | |
if File.exist?("3memo.sqlite3") then | |
File.delete("3memo.sqlite3") | |
end |
(function($){ | |
$.fn.test = function(){ | |
this.on('mousedown',mousedownFunc(this)); | |
this.name = "NAMENAME"; | |
} | |
function mousedownFunc(obj){ | |
return function(e){ | |
alert(obj.name); | |
}; | |
} |
(function($){ | |
$.fn.test = function(){ | |
this.on('mousedown',mousedown); | |
this.name = "NAMENAME"; | |
} | |
var mousedown = function(e){ | |
// ここで this.name の値を知るにはどうする? | |
} | |
})(jQuery); |
require "hondana" | |
include Hondana | |
shelf = Shelf.new('増井') | |
shelf.books.each { |book| | |
puts book.isbn | |
puts book.title | |
} | |