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
<script src="http://gist.github.com/231518.js"></script> |
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 SnippetsController < ApplicationController | |
def test | |
@member = Member.find(params[:id]) | |
render :format => :rjs | |
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
page << "document.write(\"#{ | |
content_tag(:link, | |
nil, | |
:rel => "stylesheet", :type => "text/css", | |
:href => url_for(:controller => :stylesheets, :action => :default, :format => :css)).gsub(/["']/, '\\"') | |
}\");" | |
page << "document.write(\"#{ | |
render(:partial => 'members/part_show.html.erb').gsub(/\n/, '\\n').gsub(/"/, '\\"') | |
}\");" |
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
<script type="text/javascript" src="http://your.host/snippets/test/1.js"></script> |
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
:config: | |
:user: "udzura" | |
:pass: "udzura_dummy_pass" | |
:target: "sudori" |
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
Date.new(2009).enum_for(:upto, Date.new(2009, -1, -1)).select{|d| d.cwday >= 6}.to_a.map(&:to_s) | |
=> ["2009-01-03", "2009-01-04", "2009-01-10", "2009-01-11", "2009-01-17", | |
"2009-01-18", "2009-01-24", "2009-01-25", "2009-01-31", "2009-02-01", "2009-02-07", | |
"2009-02-08", "2009-02-14", "2009-02-15", "2009-02-21", "2009-02-22", "2009-02-28", | |
"2009-03-01", "2009-03-07", "2009-03-08", "2009-03-14", "2009-03-15", "2009-03-21", | |
"2009-03-22", "2009-03-28", "2009-03-29", "2009-04-04", "2009-04-05", "2009-04-11", | |
"2009-04-12", "2009-04-18", "2009-04-19", "2009-04-25", "2009-04-26", "2009-05-02", | |
"2009-05-03", "2009-05-09", "2009-05-10", "2009-05-16", "2009-05-17", "2009-05-23", | |
"2009-05-24", "2009-05-30", "2009-05-31", "2009-06-06", "2009-06-07", "2009-06-13", | |
"2009-06-14", "2009-06-20", "2009-06-21", "2009-06-27", "2009-06-28", "2009-07-04", |
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
### install rubies | |
# install ruby 1.8.7 | |
sudo aptitude install ruby1.8 ruby1.8-dev irb1.8 rubygems1.8 rake | |
# おまじない | |
sudo mv /usr/bin/rake /usr/bin/rake1.8 | |
# install ruby1.9.1 | |
sudo aptitude install ruby1.9.1-full rubygems1.9.1 | |
# install ruby1.9.2dev |
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
### update-alternativesの設定 | |
# なぜかgemだけupdate-alternativesの管理に入って | |
# インストールされているので、一旦削除 | |
sudo update-alternatives --remove-all gem | |
# 設定 | |
sudo update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.8 120\ | |
--slave /usr/bin/irb ruby-irb /usr/bin/irb1.8\ | |
--slave /usr/bin/gem ruby-gems /usr/bin/gem1.8\ | |
--slave /usr/bin/rake ruby-rake /usr/bin/rake1.8 |