首页 软件开发 代码片段 ruby ( Page 27 )

ruby 388

#Ruby
DNSPod 动态解析(DDNS) 的 Ruby 版本

root@ubuntu:~# cat syncip.rb #!/usr/bin/env ruby #encoding:utf-8 #code by johnlen shaw req…

2015-01-13 369

#Ruby
Ruby 通过 SSH 拷贝文件到其他机器

require 'rubygems' require 'net/ssh' def copy_file(session, source_path, destination_path=…

2015-01-08 857

#Ruby
代码格式化

#!/usr/bin/ruby -w =begin /***************************************************************…

2015-01-05 448

#Ruby
ruby连接sqlite

示例1: require 'sqlite'  db = SQLite::Database.new("library.db")  db.execute("…

2015-01-05 546

#Ruby
ruby连接mysql代码

require 'mysql'    m = Mysql.new("localhost","name","password&quo…

2015-01-04 494

#Ruby
Ruby 连接PostgreSQL

require 'postgres' conn = PGconn.connect("",5432, "", "", &q…

2015-01-04 128

#Ruby
Ruby 连接到 MySQL 并执行SQL查询

require 'mysql' m = Mysql.new("localhost","ruby","secret",&q…

2015-01-04 548

#Ruby
Ruby 生成随机密码

def generate_passwd(length=16) chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ23…

2015-01-04 407

#Ruby
Ruby 之 TkButton 示例

require 'tk' root = TkRoot.new button = TkButton.new(root) { text "Hello, World!" command …

2015-01-04 707

#Ruby
Ruby 在 Windows 下获取当前鼠标光标的位置

result = "0"*8 # Eight bytes (enough for two longs) getCursorXY = Win32API.new("user32","G…

2015-01-04 309

#Ruby
Ruby+Erlang抓取贴吧图片

#coding utf-8 #!/usr/bin/env ruby -w require "open-uri" require "nokogiri" require "thread…

2015-01-02 894

#Ruby
rails export search results as excel by spreadsheet

require 'spreadsheet' # to create a spreadsheet file @selectedevent=Event.find_by_id(param…

2015-01-02 174
1 25 26 27 28 29 33