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
# at bottom of environment.rb | |
ActionMailer::Base.delivery_method = :smtp | |
ActionMailer::Base.default_content_type = "text/html" | |
ActionMailer::Base.smtp_settings = { | |
:address => "smtp.126.com", | |
:port => 25, | |
:domain => "www.zhaoonline.com.com", | |
:authentication => :login, | |
:user_name => "[email protected]", | |
:password => "xxxxxxxx", |
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 | |
case "$1" in | |
start) | |
/usr/local/lighttpd/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf > /dev/null 2>&1 | |
;; | |
stop) | |
killall lighttpd | |
;; | |
restart) |
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
# in app/models/ | |
class NoisyImage | |
require 'RMagick' | |
include Magick | |
attr_reader :code, :code_image | |
def initialize(length = 4) | |
text_size = 20 | |
validbglinecolors = ['#FFF', '#FFF', '#FFF', '#FFF', '#FFF'] |
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
# 关于oracle plsql developer | |
imp file=xxx fromuser=xxx touser=xxx | |
sqlplus "/as sysdba" | |
startup |
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
<?PHP | |
// First off, how many items per page? | |
$per_page = 4; | |
// Next, get the total number of items in the database | |
$num_videos = $db->getValue("SELECT COUNT(*) FROM videos where status = 'approved' ORDER BY dt"); | |
// Initialize the Pager object | |
$pager = new Pager($_GET['p'], $per_page, $num_videos); | |
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
--搜索关键字的记录 | |
CREATE OR REPLACE PROCEDURE P_NEWKEYWORD( | |
p_keyword VARCHAR | |
)IS | |
v_keyword_id number; | |
v_now date:=sysdate; | |
BEGIN | |
BEGIN | |
SELECT ID INTO v_keyword_id FROM KEYWORDS WHERE keyword=p_keyword AND ROWNUM=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
set nu | |
set autoindent | |
colorscheme evening | |
set encoding=utf-8 | |
set fileencodings=utf-8,chinese,latin-1 | |
if has("win32") | |
set fileencoding=chinese | |
else | |
set fileencoding=utf-8 | |
endif |
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
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>MODAL DEMO</title> | |
<script type="text/javascript" src="jquery-1.3.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ |
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
#产生随机的密码 | |
def generate_password | |
chars = ("a".."z").to_a + ("0".."9").to_a | |
#puts chars | |
Array.new(6, '').collect{chars[rand(chars.size)]}.join | |
end | |
#测试 | |
puts generate_password |
OlderNewer