Tool::Growl.notify("提示", "完成任务!")
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 1.6.4或者ruby-1.9.2-p180 | |
Rails 3.0.9 | |
问题描述: | |
在rails初始化中声明HOST_NAME为一个String,然后在控制器中有这样的代码: | |
str = "## " + HOST_NAME + " ##" | |
启动程序的时候会出错(rails s): | |
然后我将上面的代码改一下子: |
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
qichunren@qichunren-desktop:/opt/nginx-1.0.6$ ./configure --help | |
--help this message | |
--prefix=PATH set the installation prefix | |
--sbin-path=PATH set path to the nginx binary file | |
--conf-path=PATH set path to the nginx.conf file | |
--error-log-path=PATH set path to the error log | |
--pid-path=PATH set path to nginx.pid file | |
--lock-path=PATH set path to nginx.lock file |
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
// mark current location url | |
$("#nav_ticker").click(function(){ | |
$("#nav ul li").removeClass("active"); | |
$(this).addClass("active"); | |
window.location.hash = "tickers/cp"; | |
}); | |
$("#nav_announce").click(function(){ | |
$("#nav ul li").removeClass("active"); | |
$(this).addClass("active"); |
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
# encoding: utf-8 | |
require File.expand_path("../../config/environment", __FILE__) | |
require File.expand_path("../../app/helpers/application_helper", __FILE__) | |
class StaticPageGenerator | |
attr_reader :source_dir, :output_dir | |
def initialize(output_dir=Rails.root.join("html")) | |
@source_dir = Rails.root.join("themes/default/views") | |
@output_dir = output_dir |
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
qichunren@ubuntu:~/repos$ cat auto_pull.sh | |
#!/usr/bin/expect | |
set timeout 30 | |
cd /home/qichunren/repos/web_backend | |
spawn git pull --rebase | |
expect "[email protected]'s password:" | |
send "secretpassword\r" | |
send "\r" | |
sleep 10 |
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
# encoding: utf-8 | |
require 'rubygems' | |
require 'capybara' | |
require 'capybara/dsl' | |
# require 'capybara/rspec' | |
Capybara.run_server = false | |
Capybara.current_driver = :selenium | |
Capybara.app_host = 'http://cqrorx.com:3000' | |
Capybara.default_wait_time = 4 |
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 :dev do | |
task :s do | |
sh "thin start -d -e production -p 5000" | |
end | |
task :stop do | |
sh "kill -9 `cat tmp/pids/thin.pid`" | |
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
class ApplicationController < ActionController::Base | |
USER_NAME, PASSWORD = "xx", "secret" | |
protect_from_forgery | |
before_filter :login_from_http_auth | |
protected | |
def login_from_http_auth | |
authenticate_or_request_with_http_basic do |user_name, password| | |
user_name == USER_NAME && password == PASSWORD |
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
<%= content_for :html_head do %> | |
<%= javascript_include_tag "jquery.bbcode.js" %> | |
<%= javascript_tag do %> | |
$(function(){ | |
$("#web_message_content").bbcode({tag_bold:true,tag_italic:true,tag_underline:true,tag_link:true,tag_image:true,button_image:true,image_url:'/images/bbcode/'}); | |
$("#bbcode_preview_btn").bind("click", function(){ | |
var bbcode = $("#web_message_content").val(); | |
$.get("/utils/parse_bbcode", {id:bbcode}, function(text){ |