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 |
| // Remember to add tabindex to <a> | |
| body.no-js { | |
| a.dropdown-toggle:focus { | |
| pointer-events: none; | |
| } | |
| a.dropdown-toggle:focus + .dropdown-menu { | |
| opacity: 1; | |
| visibility: visible; | |
| pointer-events: auto; | |
| } |
| # |
| require 'csv' | |
| class Fortigate | |
| def self.export_batch_object_script(path) | |
| File.open('firewall_address', 'w+') do |f| | |
| f.write("config firewall address\n") | |
| f.write(" edit all\n") | |
| f.write(" next\n") | |
| f.write(" edit \"SSLVPN_TUNNEL_ADDR1\"\n") | |
| f.write(" set type iprange\n") |
| const byte redPin = 3; | |
| const byte greenPin = 5; | |
| const byte bluePin = 6; | |
| const byte interruptPin = 2; | |
| volatile byte mode = 0; | |
| volatile byte modeChanged = 0; | |
| unsigned long lastInterrupt; | |
| void setup() { | |
| setColourRgb(0,0,0); |
| /************************************************************* | |
| Download latest Blynk library here: | |
| https://github.com/blynkkk/blynk-library/releases/latest | |
| Blynk is a platform with iOS and Android apps to control | |
| Arduino, Raspberry Pi and the likes over the Internet. | |
| You can easily build graphic interfaces for all your | |
| projects by simply dragging and dropping widgets. | |
| Downloads, docs, tutorials: http://www.blynk.cc |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.css"> | |
| <style type="text/css"> | |
| .item { | |
| margin: 10px; | |
| float: left; |
| <style> | |
| .section { | |
| width: 960px; | |
| margin: auto; | |
| border: 1px solid #888; | |
| padding: 40px 0; | |
| } | |
| .clearfix { | |
| clear: both; |
在網站中提供搜尋、篩選與排序功能在現在的網站中已是基本需求,畢竟大家的耐心,在 Ruby on Rails 中,由於採用了 ActiveRecord 作為 ORM 框架的緣故,要快速的組出 Search Query 並非難事。
基本上只要搭配上 Form Object 與 Query Object 模式,要優雅的完成好維護的搜尋模組還算是容易,但當你想要快速完成搜尋功能的時候,Ransack 絕對是你的好夥伴。
Ransack 的基本設定極其簡單,只要安裝完後基本上就可以使用了。