This file contains 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" | |
require "sinatra" | |
require "json" | |
set :public_folder, Dir.pwd | |
get "/" do | |
content_type 'application/json' | |
Dir["**/*"].select { |f| ["mp4", "m4v"].include? f.split(".").last.downcase }.to_json | |
end |
This file contains 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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: sshd | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: | |
# Short-Description: OpenBSD Secure Shell server | |
### END INIT INFO |
This file contains 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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: sshd_ofc | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: | |
# Short-Description: OpenBSD Secure Shell server (ofc) | |
### END INIT INFO |
This file contains 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
http://devstreaming.apple.com/videos/techtalks/2013/11_App_Developer_Day_Kickoff/App_Developer_Day_Kickoff-hd.mov?dl=1 | |
http://devstreaming.apple.com/videos/techtalks/2013/11_App_Developer_Day_Kickoff/App_Developer_Day_Kickoff-sd.mov?dl=1 | |
http://devstreaming.apple.com/videos/techtalks/2013/11_App_Developer_Day_Kickoff/App_Developer_Day_Kickoff.pdf?dl=1 | |
http://devstreaming.apple.com/videos/techtalks/2013/12_User_Interface_Design_for_iOS_7_Apps/User_Interface_Design_for_iOS_7_Apps-hd.mov?dl=1 | |
http://devstreaming.apple.com/videos/techtalks/2013/12_User_Interface_Design_for_iOS_7_Apps/User_Interface_Design_for_iOS_7_Apps-sd.mov?dl=1 | |
http://devstreaming.apple.com/videos/techtalks/2013/12_User_Interface_Design_for_iOS_7_Apps/User_Interface_Design_for_iOS_7_Apps.pdf?dl=1 | |
http://devstreaming.apple.com/videos/techtalks/2013/13_Architecting_Modern_Apps_Part_1/Architecting_Modern_Apps_Part_1-hd.mov?dl=1 | |
http://devstreaming.apple.com/videos/techtalks/2013/13_Architecting_Modern_Apps_Part_1/Architecting_Modern_Apps_Part_1- |
This file contains 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
diff --git a/Gemfile b/Gemfile | |
index cd8ce57..2296549 100644 | |
--- a/Gemfile | |
+++ b/Gemfile | |
@@ -1,4 +1,4 @@ | |
-source "https://rubygems.org" | |
+source "http://ruby.taobao.org" | |
group :development do | |
gem 'rake', '~> 0.9' |
This file contains 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
#!/usr/bin/env ruby | |
require "FileUtils" | |
include FileUtils | |
exit if ARGV.size != 1 | |
cd ARGV[0] do | |
Dir["*.dat"].each do |dat| | |
basename = File.basename(dat, ".dat") |
This file contains 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
#!/usr/bin/env ruby | |
require "open-uri" | |
pic = "http://xxxx.b0.upaiyun.com/1/attachments/ZWg3nr1E.jpg" | |
open("test_no_ua.jpg", "w+") do |f| | |
begin | |
f.write(open(pic).read) | |
rescue Exception => e |
This file contains 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
#!/usr/bin/env ruby | |
require "FileUtils" | |
require "csv" | |
include FileUtils | |
Dir["*.csv"].each do |dat| | |
basename = File.basename(dat, ".csv") | |
outfile_name = "#{basename}.kml" | |
open(outfile_name, "w+") do |out| |
This file contains 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
#!/usr/bin/env ruby | |
# encoding = UTF-8 | |
# 模拟导航数据转换GPS坐标算法 | |
# 接受一个参数,指定模拟导航数据文件的名字 | |
path = ARGV[0] | |
open("result.txt", "w+") do |f| | |
open(path).each_line do |line| | |
x, y = line.sub("[", "").sub("]", "").split(",").map {|i| |
This file contains 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
#!/usr/bin/env ruby | |
# Rotate video files. | |
require 'shellwords' | |
require 'colorize' | |
TMPFILE = "/tmp/ffprobe_out.txt" | |
IMAGES = ["mjpeg", "jpg", "jpeg", "png", "gif"] | |
if (`which ffmpeg` == "") | |
puts "You need ffmpeg to use this command." |