Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am keating on github.
  • I am keating ( on keybase.
  • I have a public key ASDhCcfHWZIv38FpG4HGYJDNutvbeerZAf9X5aAkuQgIEgo

To claim this, I am signing this object:

keating / sort_englishpod.rb
Last active August 29, 2015 14:24
Change the track titles of EnglighPod mp3 files, so they are in the correct order in iTunes.
# use gem 'ruby-mp3info'
require "mp3info"
dir_root = "/Users/keating/Music/EnglishPod 1-50/"
d =
flags = ('A'..'Z').to_a
d.each do |dir_name|
next if ['.', '..', '.DS_Store'].include?(dir_name)
if + dir_name)
dir = + dir_name)
describe "Admin see company list" do
subject {page}
describe "when there are no companies" do
before do
@admin = FactoryGirl.create(:developer_admin)
it "displays an empty company list" do
keating / keating_test.rb
Last active August 29, 2015 13:59
Keating's Test
#1. The first Test
#The command is,
#rails g migration AddPermalinkToPosts permalink:string:uniq
#In the migration file that just generated, I will add some code, then the migration file should be,
class AddPermalinkToPosts < ActiveRecord::Migration
def change
add_column :posts, :permalink, :string
add_index :posts, :permalink, unique: true"id,title").each do |post|
keating / blog_feed
Created May 20, 2013 15:44
require 'rss/2.0'
require 'open-uri'
require 'timeout'
module PagesHelper
def blog_feed
html = ""
keating / centos_apache
Last active December 15, 2015 23:58
Centos Apache Rails configuration
Coping the following codes:
LoadModule proxy_module modules/
LoadModule proxy_http_module modules/
<VirtualHost *:80>
DocumentRoot /usr/local/pro/future_cadre
ProxyRequests Off
Exception in MqBase::get()---incompatible marshal file format (can't be read)
format version 4.8 required; 83.84 given;time:2 q_carstate
Exception in MqBase::get()---marshal data too short;time:3 q_carstate
Exception in MqBase::get()---marshal data too short;time:4 q_carstate
Exception in MqBase::get()---Timeout::Error;time:1 q_dispatcher
keating / 测试.rb
Last active December 11, 2015 09:28
# 测试登录,omniauth-identity
it "will show save search button in home" do
OmniAuth.config.test_mode = false
user ||= FactoryGirl.create(:identity_first)
visit login_path
within("form") do
fill_in 'auth_key', with:
keating / cpu.rb
Created January 12, 2013 09:31
测试JRuby性能代码 Codes for test JRuby performance || Comparing ruby1.9 and JRuby performance { { while true do end }
keating / jruby-test.txt
Last active December 10, 2015 19:38
jruby 性能测试
启动(点击首页) 查询提单 打开两个浏览器轮流查询 2分钟不操作
CRuby 1.8% 2.5% 3.5% 3.5%
JRuby 10.9% 11.0% 11.9% 11.9%
CRuby 30%
JRuby 40%