Skip to content

Instantly share code, notes, and snippets.

View qichunren's full-sized avatar
🌈
Focusing contribute

Qichunren qichunren

🌈
Focusing contribute
View GitHub Profile
@qichunren
qichunren / 验证码图片
Created February 5, 2010 07:26
验证码程序
# 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']
@qichunren
qichunren / start.sh
Created January 9, 2010 07:20
put this file at RAILS_ROOT
#!/bin/sh
case "$1" in
start)
/usr/local/lighttpd/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf > /dev/null 2>&1
;;
stop)
killall lighttpd
;;
restart)
# 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",
@qichunren
qichunren / gist:272768
Created January 9, 2010 07:10
conf file for lighttpd server with fastcgi
We couldn’t find that file to show.