##步骤:
- 安装MacVim并用它打开你的源代码
- 选择菜单栏中_Syntax_下的_Convert to HTML_
- 选中新创建的包含HTML的buffer,然后选择_Files » Save_
- 在Safari中打开这个HTML文件( 它与你的源代码在同一个目录下)。你会看见一份完美复制了源代码在MacVim中样式的网页。
- 接下来只需选中Safari中显示的代码并拖拽到Keynote的页面中即可。下面附上一份源代码转换后的HTML样例,你可以将它保存文件后用浏览器打开,便可知道它看起来如何。
# in Vim | |
:args ~/src/myproject/**/*.ttl | argdo execute "normal gg=G" | update |
var exampleDictionary = ["foo":1,"bar":2] | |
// an optional type means its value can either be some certain type or nothing at all( nil) | |
var optionalTypeVariable: Int? = exampleDictionary["someUncertainValue"] | |
// calling optionalTypeVariable will either return an integer or a nil, so you should normally check it’s value before actually using it | |
if optionalTypeVariable == nil { | |
println("The value of optionalTypeVariable is nil") | |
} else { | |
// calling optionalTypeVariable! will always return an integer, if optionalTypeVariable is in fact nil, then an assertion will be triggered. |
# syntax: ModelName.joins(:association_name).where({joining_table_name: {column_name:"column value"}}) | |
ContactField.joins(:contact_field_type).where({constr_base_contact_field_types: {name:"Email"}}) |
# in normal mode | |
con |
curl -i -F name=test -F filedata=@localfile.jpg http://example.org/upload |
ConstrBase::Trade.find_each do |trade| | |
if matches = /^((\S+\s+)+(\S*))\s*$/.match(trade.name) | |
trade.name = matches[1] | |
trade.save | |
end | |
end |
<div class="row"> | |
<div class="col-xs-11"> | |
<div class="row"> | |
<div class="col-xs-2"> | |
</div> | |
<div class="col-xs-2"> | |
</div> | |
<div class="col-xs-2"> | |
</div> | |
<div class="col-xs-2"> |
##步骤:
curl -XPOST -H "Content-Type: application/json" -d '{"document": {}}' http://127.0.0.1:3000/documents/search.xls -v |
Rule of thumb:
Rails by default prints datetime in ISO8601 format in %Y-%m-%d %H:%M:%S +offset
style, e.g. 2014-12-18 13:00:00 +1000
and encode datetime in JSON as standard_son_format, e.g. 2005-02-01T05:15:10.000-10:00
Angular formats datetime in timezone of the browser if timezone option of date filter is not specified.
Browsers format datetime string based on local date format settings. But browsers only support datetime-local picker.
With Rails datetime_local_field, the timezone is ignored, it outputs something like this ``.