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
day | amount | |
---------------------+-------- | |
2013-11-02 00:00:00 | 7 | |
2013-11-03 00:00:00 | 4 | |
2013-11-04 00:00:00 | 5 | |
2013-11-05 00:00:00 | 33 | |
2013-11-06 00:00:00 | 15 | |
2013-11-07 00:00:00 | 15 | |
2013-11-08 00:00:00 | 17 | |
2013-11-09 00:00:00 | 15 |
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 'rubygems' | |
f = File.open("words.txt") | |
f1 = File.new("output.xml", "wb") | |
f2 = File.new("error.txt", "wb") | |
f1.write "<wordbook>\r\n" | |
while line = f.gets |
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
[2014-10-27T00:24:17-07:00] INFO: Forking chef instance to converge... | |
[2014-10-27T00:24:17-07:00] INFO: *** Chef 11.10.4 *** | |
[2014-10-27T00:24:17-07:00] INFO: Chef-client pid: 11300 | |
[2014-10-27T00:24:17-07:00] WARN: Run List override has been provided. | |
[2014-10-27T00:24:17-07:00] WARN: Original Run List: [] | |
[2014-10-27T00:24:17-07:00] WARN: Overridden Run List: [role[rails_srv]] | |
[2014-10-27T00:24:17-07:00] INFO: Run List is [role[rails_srv]] | |
[2014-10-27T00:24:17-07:00] INFO: Run List expands to [ruby, memcached, nginx::source, redisio::install] | |
[2014-10-27T00:24:17-07:00] INFO: Starting Chef Run for ubuntu | |
[2014-10-27T00:24:17-07:00] INFO: Running start handlers |
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 'date' | |
file_paths = Dir.glob("/BACKUP_DIR/*.dump") | |
file_paths.map! do |file_path| | |
basename = File.basename(file_path, '.dump') | |
key = Date.parse(basename) | |
[key, file_path] | |
end.sort! do |a, b| | |
a[0] <=> b[0] |
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 'securerandom' | |
module ActiveSupport | |
module Notifications | |
# Instrumenters are stored in a thread local. | |
class Instrumenter | |
attr_reader :id | |
def initialize(notifier) | |
@id = unique_id |
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
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse |
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
function numberToChinese(number) { | |
var UNIT = ['', '十', '百']; | |
var NUMBER = ['', '一', '二', '三', '四', '五', '六', '七', '八', '九']; | |
if (number == 0) { | |
return '零'; | |
} | |
if (number > 999) { | |
throw new Error('Too Big'); |
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
# _ooOoo_ | |
# o8888888o | |
# 88" . "88 | |
# (| -_- |) | |
# O\ = /O | |
# ____/`---'\____ | |
# . ' \\| |// `. | |
# / \\||| : |||// \ | |
# / _||||| -:- |||||- \ | |
# | | \\\ - /// | | |
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
params = { | |
bucket: "your_bucket", | |
key: "j7m3jm9io.mp4", | |
fops: "avthumb/mp4/vcodec/libx264/vb/512k/r/24/vb/256k/acodec/libfaac/ab/64k|saveas/bGFpMWtlLWRldjpnb3Uyem9yaWRqbnN0dDktbWVkaXVtLm1wNA==", | |
pipeline: "neolion", | |
notifyURL: "http://example.com/callback/qiniu_transcoded/23" | |
} | |
http_code, resp = Qiniu::Fop::Persistance.pfop params |
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
source "https://ruby.taobao.org" | |
ruby "2.1.6" | |
### Main | |
gem 'rails', '4.2.3'#, github: 'rails/rails' | |
gem 'sdoc', '~> 0.4.0', group: :doc # Document is **IMPORTANT**, `bin/rake doc:rails` | |
gem 'pg' # Postgresql Driver | |
gem "redis", "~> 3.1", require: ["redis/connection/hiredis", "redis"] | |
gem "hiredis" |