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
| namespace "binary" do | |
| desc "detect unknown binary chars from source codes" | |
| task "check" do | |
| c2a0 = /\xc2\xa0/no | |
| files = Dir.glob("{app,config,lib}/**/*.{rb,html,erb.haml}") | |
| files.each do |file| | |
| buf = File.read(file){} | |
| if c2a0 === buf | |
| puts "[C2A0] detected in [%s]" % file | |
| File.readlines(file).each_with_index do |line, i| |
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
| Xinha.prototype._shortCuts = function (ev) | |
| { | |
| var key = this.getKey(ev).toLowerCase(); | |
| var cmd = null; | |
| var value = null; | |
| switch (key) | |
| { | |
| // simple key commands follow | |
| case 'b': cmd = "bold"; break; |
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
| シナリオ: 営業がページを見る | |
| 前提 未来の確定案件1が存在し | |
| もし "入稿情報1"を開く | |
| ならば "商品詳細1"へのリンクがある | |
| かつ "クリエイティブ"が非表示 | |
| かつ "入稿情報"が非表示 |
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
| フィーチャ: spymaster の自動レベル上げ | |
| シナリオ: 指定タスクを実行 | |
| 前提 タスクページへ移動 | |
| 実行 体力が"45"以上なら"steal_embassy_documents"タスクを連続実行 |
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
| module ApplicationHelper | |
| def partial(file, opts = {}) | |
| opts[:partial] = file | |
| controller.__send__ :render_to_string, opts | |
| end | |
| 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
| %table{:width=>"100%", :cellspacing=>"1", :cellpadding=>"0", :border=>"1"} | |
| %tbody | |
| %tr{:bgcolor=>"#eeeeee"} | |
| %th{:colspan=> 1 + dss.size}掲載期間 | |
| - if dss.blank? | |
| %tr | |
| %td{:align=>"center", :style=>"background-color:white;"} | |
| .nothing{:style=>"padding:20px;color:tomato;"} なし | |
| - else | |
| - dss.select{|ds| ds.is_a?(DeliverySchedule)}.each_with_index do |ds, i| |
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
| class Foo | |
| foo : puts "foo" | |
| bar : | |
| puts "bar" | |
| puts "hello" | |
| baz : "BAZ" | |
| Foo.new.foo |
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
| class Foo | |
| dsl_accessor | |
| foo { puts "foo" } | |
| bar { | |
| puts "bar" | |
| puts "hello" | |
| } | |
| baz { "BAZ" } | |
| 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
| % jruby -J-Xmx2048m =merb -i | |
| irb(main):001:0> buf = File.read('/tmp/1GB.txt'); buf.size | |
| Error: Your application used more memory than the safety cap of 2048m. | |
| Specify -J-Xmx####m to increase it (#### = cap size in MB). | |
| Specify -w for full OutOfMemoryError stack trace | |
| % jruby -J-Xmx4096m =merb -i | |
| Invalid maximum heap size: -Xmx4096m | |
| The specified size exceeds the maximum representable size. | |
| Could not create the Java virtual machine. |
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' | |
| ###################################################################### | |
| ### ActiveRecord (PostgreSQL) | |
| require 'active_record' | |
| ActiveRecord::Base.establish_connection(:adapter=>"postgresql", :database=>"jpop", :user=>"maiha") | |
| module PG | |
| class Song < ActiveRecord::Base | |
| # Indexes: "index_songs_singer" btree (singer) |