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 Autotest::Growl | |
def self.growl title, msg, img="~/.autotest_icons/rails_ok.png", pri=0, sticky="" | |
msg += " at #{Time.now.strftime('%Y-%m-%d %H:%M:%S')}" | |
system "growlnotify -n autotest -H localhost --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{sticky}" | |
end | |
Autotest.add_hook :ran_command do |at| | |
output = at.results.last.slice(/(\d+)\s+tests,\s*(\d+)\s+assertions,\s*(\d+)\s+failures,\s*(\d+)\s+errors/) | |
if output | |
if $~[3].to_i > 0 || $~[4].to_i > 0 |
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 | |
print "Specify dbname: " | |
dbname = gets.chomp | |
pids = `psql -U postgres -c "select procpid from pg_stat_activity where datname = '#{dbname}'"`.scan(/^\s+(\d+)$/) | |
pids.flatten.each do |pid| | |
print "Kill #{pid}?[yN] " | |
system "sudo kill -9 #{pid}" if gets.chomp.downcase == "y" | |
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
class TestPublisher < Facebooker::Rails::Publisher | |
def profile_update(user, profile_fbml) | |
send_as :profile | |
recipients user | |
from user | |
profile profile_fbml | |
profile_main profile_fbml | |
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
<fb:if-section-not-added section="profile"> | |
<p>You need one more action to complete. Click the button below.</p> | |
<fb:add-section-button section="profile" /> | |
</fb:if-section-not-added> |
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
_translations = { | |
"OK": "OK", | |
"Now": "現在", | |
"Today": "今日", | |
"Clear": "閉じる" | |
} | |
Date.weekdays = $w("日 月 火 水 木 金 土"); | |
Date.months = $w("1月 2月 3月 4月 5月 6月 7月 8月 9月 10月 11月 12月" ); |
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
Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - 24 : hour ) } | |
Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } | |
Date.prototype.toFormattedString = function(include_time){ | |
str = this.getFullYear() + '/' + Date.padded2(this.getMonth() + 1) + '/' +Date.padded2(this.getDate()); | |
if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() } | |
return 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
CalendarDateSelect::FORMATS[:japanese] = { | |
:date => "%Y/%m/%d", | |
:time => " %H:%M", | |
:javascript_include => "format_japanese" | |
} | |
CalendarDateSelect.format = :japanese | |
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
if (this.options.get("buttons")) { | |
buttons_div.build("br"); | |
buttons_div.build("span", {innerHTML: " "}); |
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
out << image_tag(image, | |
:alt => "カレンダーから入力", | |
:onclick => "new CalendarDateSelect( $(this).previous(), #{options_for_javascript(javascript_options)} );", | |
:style => 'border:0px; cursor:pointer;', | |
:class=>'calendar_date_select_popup_icon') |
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
/* | |
Script that darken a hex color. | |
Released under the MIT license | |
Junya Ishihara <[email protected]> | |
http://champierre.com | |
*/ | |
function darken(hexstr, scalefactor) { |
OlderNewer