TODO: Write a project description
TODO: Describe the installation process
Aptfile加入 | |
wget | |
======================= | |
m2-build.sh chmod 755,加入 | |
export HOME=/root | |
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && dpkg -i erlang-solutions_1.0_all.deb | |
apt-get update -y |
id | |
binary_id | |
integer | |
float | |
boolean | |
string | |
binary | |
{:array, inner_type} | |
{:map, inner_type} | |
map |
<%# view fragment %> | |
<% @topic_categories.each do |category| %> | |
<li role="presentation"><a v-on:click="one('<%= category.meta_key %>')" aria-controls="<%= category.meta_key %>" role="tab" data-toggle="tab"><%= category.send('name_'+ get_locale) %></a></li> | |
<% end %> | |
<tbody id="topics"> | |
<tr v-for="topic in topics"> | |
<td>{{ topic | locale }}</td> | |
<td>{{ topic.created_at | moment }}</td> | |
<td>{{ topic.title_zh }}</td> |
... | |
def index | |
@topics = Topic.joins(:topic_category).select('topics.id','topics.title_zh','topics.title_en','topics.topic_messages_count','topics.created_at','topic_categories.meta_key','topic_categories.name_zh','topic_categories.name_en') | |
.order("topics.created_at desc").page(params[:page]).per(10) | |
@topic_categories = TopicCategory.order("order_date desc") | |
end | |
... |
import React, { PropTypes } from 'react'; | |
import { connect } from 'react-redux'; | |
import { pushPath } from 'redux-simple-router'; | |
export function requireAuthentication(Component) { | |
class AuthenticateComponent extends React.Component { | |
constructor(props) { | |
super(props); | |
} |
#osx | |
brew install graphicsmagick | |
brew install vips | |
#linux | |
sudo aptitude install libvips-dev libmagickwand-dev libxml2-dev | |
#加裝libxml2在路徑裡 | |
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig |
Nginx使用者請看這 | |
由於Let's Encrypt的安裝程式目前還沒有提供nginx模組(其實有在開發,只是還在測試階段),我們依舊可以透過安裝程式自動取得certification後,手動更新nginx的設定黨即可。 | |
首先,我們先取得免費的憑證: | |
# 如果nginx正在執行中,請先把它關閉 | |
$ sudo -s | |
$ service nginx stop | |
$ ./letsencrypt-auto certonly --email 你的email@你的email.net -d freessl.csie.io |
●sublime_rubocop | |
Ruby的style guide | |
●BeautifyRuby | |
Ruby排版 | |
●Sublime-HTMLPrettify | |
html,js,css排版 | |
●ERB-Sublime-Snippets | |
erb用的快速鍵 | |
●sublime-better-coffeescript | |
coffeescript用的快速鍵 |
大部分的時候,RubyGem都可以直接使用。 | |
但是Ruby有個大問題是:如果出錯的話,你很難找到為什麼出錯。 | |
通常在使用Gem的時候你不會遇到什麼問題,如果運氣不好碰到的話,Google也沒什麼用 | |
如果你不知道Gem到底是怎麼和程式一起運作的話,你就會花很多時間在debug上。 | |
Gem的運作有點像在變魔術,不過花點時間研究,它其實很好懂的。 | |
gem install做了什麼事? | |
一個Ruby gem只是一些打包起來的code,加上一些額外的data。 |