Thus, only alphanumerics, the special characters "$-_.+!*'(),", and reserved characters used for their reserved purposes may be used unencoded within a URL.
http://stackoverflow.com/questions/1856785/characters-allowed-in-a-url
如果一定要展示“中文”需要转码成这样:
"#{id} #{URI.escape name}".parameterize
# => id-%E4%B8%AD%E6%96%87
两种方法:
用 Foreman 在生产环境中管理和监控进程 http://chloerei.com/2014/12/15/foreman/
我把防火墙规则写到 Linode 的 StackScripts,避免忘了设置。
# firewall
ufw allow ssh
ufw allow http
ufw allow https
ufw logging on
ufw enable
#2 楼 @nouse 他吐槽的是安装 Ruby 所用的包管理器。
Package managers suck. Compiling the sources is far quicker.
https://twitter.com/joeerl/status/557190665332064256
如果他说的是 Gems,那么解决方法应该是下载 gem 包源码,然后 rake install。
哪里吐槽 Gems 了?
之前在局域网,现在放到互联网了。
我觉得这个有做成 rack middleware 的潜力。
朕知道了。
谁说的?
mysqldump mysqlimport cp -r
我屏幕好像花了。
<button type="submit">
<img src="path/to/image">
</button>
resque
我读书少你不要骗我,4.2.0 生成的脚手架明明是这样的:
class ProjectsController < ApplicationController
before_action :set_project, only: [:show, :edit, :update, :destroy]
# GET /projects
# GET /projects.json
def index
@projects = Project.all
end
# GET /projects/1
# GET /projects/1.json
def show
end
# GET /projects/new
def new
@project = Project.new
end
# GET /projects/1/edit
def edit
end
# POST /projects
# POST /projects.json
def create
@project = Project.new(project_params)
respond_to do |format|
if @project.save
format.html { redirect_to @project, notice: 'Project was successfully created.' }
format.json { render :show, status: :created, location: @project }
else
format.html { render :new }
format.json { render json: @project.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /projects/1
# PATCH/PUT /projects/1.json
def update
respond_to do |format|
if @project.update(project_params)
format.html { redirect_to @project, notice: 'Project was successfully updated.' }
format.json { render :show, status: :ok, location: @project }
else
format.html { render :edit }
format.json { render json: @project.errors, status: :unprocessable_entity }
end
end
end
# DELETE /projects/1
# DELETE /projects/1.json
def destroy
@project.destroy
respond_to do |format|
format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_project
@project = Project.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def project_params
params[:project]
end
end
4.2.0 一个需要注意的改动就是类级 respond_to
移到了 gem http://guides.rubyonrails.org/4_2_release_notes.html#respond-with-class-level-respond-to
半年前用过一下发现 flex-grow 在 safari 下有问题,于是换回基于浮动和百分比的布局。
调用支付宝接口,不但要 timeout,还要 retry。
ERROR: Could not find a valid gem 'nokorigi' (>= 0) in any repository
ERROR: Possible alternatives: nokogiri, nokorexi, nokogirl
你不看字的么……
你两个问题不是冲突了么。
The problem with Angular http://www.quirksmode.org/blog/archives/2015/01/the_problem_wit.html
Hacker News http://cheeaun.github.io/hackerweb/#/item/8886041
rake 版本写到 Gemfile 然后 bundle exec rake
Y Combinator 经历也要晒一晒嘛。