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
" Vim syntax file | |
" Language: tmt | |
" Maintainer: Kan Fushihara | |
" Installation: | |
" To automatilcally load this file when a .rhtml file is opened, add the | |
" following lines to ~/.vim/filetype.vim: | |
" | |
" augroup filetypedetect | |
" au! BufRead,BufNewFile *.tmt setfiletype tmt | |
" augroup 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
case Merb::Config[:adapter] | |
when 'irb' | |
Merb::Config.use do |c| | |
c[:log_auto_flush ] = true | |
c[:log_level] = :debug | |
c[:log_stream] = STDOUT | |
c[:log_file] = nil | |
# Or redirect logging into a file: | |
# c[:log_file] = Merb.root / "log" / "development.log" |
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
diff --git root/static/js/remedie.js root/static/js/remedie.js | |
index 303a631..a497f90 100644 | |
--- root/static/js/remedie.js | |
+++ root/static/js/remedie.js | |
@@ -53,6 +53,26 @@ Remedie.prototype = { | |
}); | |
this.installHotKey('shift+u', function(){ remedie.toggleChannelView(false) }); | |
+ | |
+ // LDRize like keyborad shortcut. |
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 Measure | |
class Unit | |
class << self | |
def unit_name | |
return nil | |
end | |
alias __inspect__ inspect | |
def inspect | |
if unit_name |
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
==> randexp_spec.rb <== | |
begin | |
require 'spec/fixture' | |
require 'randexp' | |
describe "randexp" do | |
with_fixtures :template => :expect do | |
it do |template,expect| | |
warn template | |
10.times do |
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 'benchmark' | |
$LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib' ))) | |
require 'randomaze' | |
COUNT = 1000 | |
template_str = 'abc[a-z]{3}foobar[0-9あいう]{5}__hoge' | |
parse_result = Randomaze::String::TemplateParser.parse(template_str) |
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
100.times do | |
100.times do | |
th = Thread.fork do | |
File.open("/tmp/thread/#{Thread.current.object_id}", "w") do |io| | |
io.puts("a" * 10000) | |
end | |
end | |
th.join | |
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
require 'zipper' | |
require 'benchmark' | |
MAX = 5000 | |
Benchmark.bm do |x| | |
x.report "zipper" do | |
original = Zipper.make(*(0..MAX).to_a) | |
zippers = (0..MAX).map{|i| | |
original.next.set(i) | |
} |