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
// 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
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
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>无标题文档</title> | |
<script language="javascript"> | |
function checkregform(){ | |
alert("验证开始了!"); | |
if (document.yx.name.value==""){ | |
alert("请填写宝宝的姓名!"); |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: tomcat | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the tomcat web server | |
# Description: starts tomcat using start-stop-daemon |
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 *** | |
2011-10-25 12:07:32 | |
温度000: 0c | |
温度001: 0c | |
湿度000: 0%RH | |
湿度001: 0%RH |
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 'socket' | |
socket = UDPSocket.new | |
socket.send("I am ok.", 0, 'localhost', 1234) | |
text, sender = socket.recvfrom(16) | |
socket.close |
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
#!/bin/bash | |
if [ ! -d /root/backup/sql ]; then | |
mkdir -p /root/backup/sql | |
fi | |
cd /root/backup/sql | |
database_yml=/www/ntdeck_secart/WEB-INF/config/database.yml | |
date_str=`date +%Y_%m_%d_%H_%M` | |
db_username=`grep user $database_yml | awk '{print $2}' | sed -n 3p` |