sudo yum -y install epel-release
sudo yum -y update
Download repository
| import Foundation | |
| let cst = TimeZone(secondsFromGMT: 8 * 3600)! | |
| func createDate(_ year: Int, _ month: Int, _ day: Int) -> Date { | |
| var components = DateComponents() | |
| components.year = year | |
| components.month = month | |
| components.day = day | |
| components.calendar = Calendar(identifier: .gregorian) |
| // Simple move average | |
| function sma(data, dataLength, sampleRate=250, frequency=50) { | |
| if (data.length === 0) return data; | |
| const filterTL = Math.round(sampleRate / frequency) | |
| const filteredData = [] | |
| if (filterTL > dataLength) { | |
| throw new Error('Data length is not enough.') | |
| } | |
| else { | |
| for (let i = 0; i < dataLength; ++i) { |
| #!/usr/bin/env ruby | |
| require 'rubyXL' | |
| workbook = RubyXL::Parser.parse("test.xlsx") | |
| workbook.worksheets.each do |worksheet| | |
| out_sql = open("#{worksheet.sheet_name}.sql", 'w+') | |
| current_row = 1 # 跳过第一行表头 | |
| blank_rows = 0 # 空行计数器 |
| #!/usr/bin/env ruby | |
| # Generate gpx for Xcode from Google Earth kml. | |
| require 'time' | |
| require 'nokogiri' | |
| seconds_per_point = 2 | |
| timestamp = Time.now.to_i | |
| doc = Nokogiri::XML(open(ARGV[0])) |
| #!/bin/bash | |
| # Set up your username stuff here: | |
| DDNS_USER=YOUR_USERNAME | |
| DDNS_PASS=YOUR_PASS | |
| DDNS_PREFIX=YOUR_DDNS_PREFIX | |
| IP_TMP=/tmp/current_ip | |
| CURL_PATH=/usr/bin/curl | |
| current_ip=$(${CURL_PATH} -s whatismyip.akamai.com) |
| #!/usr/bin/env ruby | |
| # Generate json for iGolf 2 location simulation. | |
| require 'nokogiri' | |
| require 'json' | |
| doc = Nokogiri::XML(open(ARGV[0])) | |
| coordinates = doc.css('coordinates').text.strip.split(/\s+/).map { |s| s.split(',') } | |
| arr = [] |
| #!/usr/bin/env ruby | |
| # Simple script that update namecheap ddns. | |
| require 'open-uri' | |
| require 'nokogiri' | |
| require 'json' | |
| HOST='' | |
| DOMAIN='' | |
| PASSWORD='' |