Skip to content

Instantly share code, notes, and snippets.

View YushengLi's full-sized avatar

Yusheng Li YushengLi

  • Taiwan
  • 18:02 (UTC +08:00)
View GitHub Profile
@YushengLi
YushengLi / redis-autostart-osx.md
Last active September 22, 2015 12:10 — forked from subfuzion/redis-autostart-osx.md
redis auto start OS X

Install with Homebrew

brew install redis

Set up launchctl to auto start redis

$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents

/usr/local/opt/redis/ is a symlink to /usr/local/Cellar/redis/x.y.z (e.g., 2.8.7)

# install.packages("RCurl")
library(RCurl)
URL <- "http://www.twse.com.tw/ch/trading/fund/BFI82U/BFI82U_print.php?begin_date=20150918&end_date=20150918&report_type=day&language=ch&save=csv"
# Download data from URL and set encoding to Big5
rawData <- getURL(URL, .encoding='big5')
# Convert Encoding from Big5 to UTF-8
rawData <- iconv(rawData, 'big5', 'utf8')
# Remove unnecessary Title by parsing data to Vector