Instantly share code, notes, and snippets.
keating /keybase.md
CreatedSeptember 11, 2019 07:56
keating /sort_englishpod.rb
Last activeAugust 29, 2015 14:24
Change the track titles of EnglighPod mp3 files, so they are in the correct order in iTunes. 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
# use gem 'ruby-mp3info' | |
require"mp3info" | |
dir_root="/Users/keating/Music/EnglishPod 1-50/" | |
d=Dir.new(dir_root) | |
flags=('A'..'Z').to_a | |
d.eachdo |dir_name| | |
nextif['.','..','.DS_Store'].include?(dir_name) | |
ifFile.directory?(dir_root +dir_name) | |
dir=Dir.new(dir_root +dir_name) |
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
describe"Admin see company list"do | |
subject{page} | |
describe"when there are no companies"do | |
beforedo | |
@admin=FactoryGirl.create(:developer_admin) | |
admin_login(@admin) | |
end | |
it"displays an empty company list"do |
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. 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, | |
classAddPermalinkToPosts <ActiveRecord::Migration | |
defchange | |
add_column:posts,:permalink,:string | |
add_index:posts,:permalink,unique:true | |
Post.select("id,title").eachdo |post| |
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 'rss/2.0' | |
require 'open-uri' | |
require 'timeout' | |
module PagesHelper | |
def blog_feed | |
html = "" | |
begin |
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
Coping the following codes: | |
``` | |
LoadModule proxy_module modules/mod_proxy.so | |
LoadModule proxy_http_module modules/mod_proxy_http.so | |
<VirtualHost *:80> | |
ServerName www.jobmre.fr | |
DocumentRoot /usr/local/pro/future_cadre | |
ProxyRequests Off |
keating /starling错误信息
CreatedJanuary 24, 2013 05:33
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
starling错误信息 | |
Exception in MqBase::get()---incompatible marshal file format (can't be read) | |
format version 4.8 required; 83.84 given;time:2 q_carstate | |
mq_base.get::q_carstate | |
Exception in MqBase::get()---marshal data too short;time:3 q_carstate | |
mq_base.get::q_carstate | |
Exception in MqBase::get()---marshal data too short;time:4 q_carstate | |
mq_base.get::q_dispatcher | |
mq_base.get::q_obsever | |
Exception in MqBase::get()---Timeout::Error;time:1 q_dispatcher |
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 | |
# 测试登录,omniauth-identity | |
it"will show save search button in home"do | |
OmniAuth.config.test_mode=false | |
user ||=FactoryGirl.create(:identity_first) | |
visitlogin_path | |
within("form")do | |
fill_in'auth_key',with:user.email |
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
2.times.map{ | |
Thread.new{whiletruedoend} | |
}.each(&:join) |
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
===development/webrick================================================================ | |
内存: | |
启动(点击首页) 查询提单 打开两个浏览器轮流查询 2分钟不操作 | |
CRuby 1.8% 2.5% 3.5% 3.5% | |
JRuby 10.9% 11.0% 11.9% 11.9% | |
CPU在查询提单时最大占用率(大约) | |
CRuby 30% | |
JRuby 40% |
NewerOlder