Gist に Markdown で書いたときって、表示はどうなるんでしたっけ...?
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 LocalContextFeature | |
def local_context(name, &block) | |
raise NameError, "local context `#{name}' is already defined" if find_local_context(name) | |
@local_contexts ||= {} | |
@local_contexts[name] = block | |
end | |
def include_local_context(name) | |
lc = find_local_context(name) | |
if lc |
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
#!/usr/bin/ruby | |
open("test.ppm", "w") do |f| | |
f.puts "P6", "256 256", "255" | |
(0..255).each do |y| | |
(0..255).each do |x| | |
f.write("%c%c%c"%[x, y, 0]) | |
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
#!/usr/bin/ruby | |
require "rubygems" | |
require "sinatra" | |
require "haml" | |
helpers do | |
def xhr(domain, id, api_suffix=nil) | |
api_suffix = "_#{api_suffix}" if api_suffix | |
<<EOT | |
//// XHR for #{domain} #{id} //// |
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
#!/usr/bin/env ruby | |
require "rack" | |
class GoogleCrawlerCollector | |
def save_log | |
open("log.log", "a") do |f| | |
f.puts "-"*40, Time.now | |
f.puts @req.env.map{|k, v| "#{k}: #{v}"}.sort.join("\n"), "" | |
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
(setq load-path | |
(append | |
(list | |
(expand-file-name "~/elisp/") | |
) | |
load-path)) | |
(setq load-path (cons "~/elisp/yatex1.74" load-path)) | |
(set-language-environment "Japanese") |