Skip to content

Instantly share code, notes, and snippets.

💭
coding...

Adam Lu dayudodo

💭
coding...
Block or report user

Report or block dayudodo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dayudodo
dayudodo / lrcParser.js
Last active Apr 13, 2017
LRC解析器
View lrcParser.js
//node程序
//传递读取到的lrc文件内容content
function lrcParser(content){
//将数据分解为数组
var data = content.replace(/\r/g,'')
var _arrayOfLrc=data.split("\n");
var _LRC={
lyrics:[]
};
View pixababy.rb
# https://pixabay.com/api/?username=dayudodo&key=13eb0e81095a3556e172&q=yellow+flower&image_type=photo
# 读取返回数据
require 'json'
require 'ostruct'
serialized = File.read("pixababy_return.json")
data = JSON.parse(serialized)
# p data["totalHits"]
View turnCSharpTimeToRubyTime.rb
def turnCSharpTimeToRubyTime(sourceTime)
reg=/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\.(\d{7})/
temp,year,month,day,hour,minute,second,nsec=reg.match(sourceTime).to_a
return [year,month,day,hour,minute,second,nsec].map{|x| x.to_i}
end
# C# time String
timeStr="2011-08-11T11:17:55.7707133+08:00"
arr=turnCSharpTimeToRubyTime(timeStr)
You can’t perform that action at this time.