与问题相关:org-mode:本机化fontify代码块
我有截至2012年11月1日的最新组织模式和emacs版本(组织存储在org-20121105中).
我也有emacs-24附带的sql-mode.
我已经得到了一个好成绩:
;; fontify code in code blocks
(setq org-src-fontify-natively t)
Run Code Online (Sandbox Code Playgroud)
然而,在我的组织文件中,这并不能说明问题.Java,bash等都可以工作.
#+BEGIN_SRC SQL
SELECT foo FROM bar
#+END_SRC
Run Code Online (Sandbox Code Playgroud)
当我打开文件foobar.sql时,模式指示符说SQL [ANSI](我也尝试作为源类型),并且字体锁定工作.
提前感谢任何提示.
很清楚如何从psql本地登录到heroku postgres数据库:https://devcenter.heroku.com/articles/heroku-postgresql#external-connections-ingress
但是,如何在本地设置database.yml以使本地rails实例与heroku数据库通信?
我遇到了在Heroku上部署的问题,在rake任务中失败了
rake assets:precompile
Run Code Online (Sandbox Code Playgroud)
在底部是我积累的错误
该错误发生在uglifier.
我怀疑这个问题可能与日历中包含许多本地化有关.
我通过设置来解决错误:
# Compress JavaScripts and CSS
config.assets.compress = false
Run Code Online (Sandbox Code Playgroud)
当临时文件被清理时,我无法检查文件.我也无法让RubyMine中的调试器停在断点处.
如果这是一个错误的任何想法?有什么办法让临时文件不被删除?任何使RubyMine调试器在rake任务上工作的方法(是的,使用EAP 112-291尝试了显而易见的事情.
rake资产:预编译:所有RAILS_ENV =生产RAILS_GROUPS =资产佣金中止!意外的字符''(行:21454,col:0,pos:641761)
新的JS_Parse_Error(/tmp/execjs20111231-15374-1fve7h4.js:497:22)在js_error(/tmp/execjs20111231-15374-1fve7h4.js:505:15)处于parse_error(/ tmp/execjs20111231-15374-1fve7h4)时出错. js:596:17)在Object.next_token [作为输入](/tmp/execjs20111231-15374-1fve7h4.js:839:17)at next(/tmp/execjs20111231-15374-1fve7h4.js:943:37)at Object .semicolon [as 1](/tmp/execjs20111231-15374-1fve7h4.js:986:38)在prog1(/tmp/execjs20111231-15374-1fve7h4.js:1527:28)的simple_statement(/ tmp/execjs20111231-15374-) 1fve7h4.js:1123:35)/tmp/execjs20111231-15374-1fve7h4.js:1031:35 attmp/execjs20111231-15374-1fve7h4.js:1510:32
Org-mode 有一个很棒的功能,可以包含这样的源代码:
#+begin_src java -n
/**
* @param foo
*/
public static void doBar(Baz ba)
{
Collection<String> strings = ba.getStrings(true);
return strings;
}
#+end_src
Run Code Online (Sandbox Code Playgroud)
该-n
选项显示行号。
可以+n
选择从最后一个块继续编号。
有没有设置起始编号的选项?这对于您希望行号与完整文件相对应的源代码片段非常有用。
与shell脚本和echo命令有关的问题: 在shell脚本中:在执行shell命令时回显shell命令
我想做这样的事情:
foo() {
cmd='ls -lt | head'
echo $cmd
eval ${cmd}
}
Run Code Online (Sandbox Code Playgroud)
我尝试了这个:
foo2() {
set -x
ls -lt | head
set +x
}
Run Code Online (Sandbox Code Playgroud)
但这会产生额外的输出
+foo2:2> ls -G -lt
+foo2:2> head
total 136
drwxr-xr-x 18 justin staff 612 Nov 19 10:10 spec
+foo2:3> set +x
Run Code Online (Sandbox Code Playgroud)
在zsh函数中,还有其他更优雅的方法吗?
我想做这样的事情:
foo() {
cmd='ls -lt | head'
eval -x ${cmd}
}
Run Code Online (Sandbox Code Playgroud)
并仅回显正在运行的cmd(也许使用别名扩展)。
在下面的代码示例中,为什么注释行无法导入标记?我正在使用https://github.com/shama/es6-loader
module $ from 'jquery';
module React from 'react';
//import { marked } from 'marked';
var marked = require("marked");
Run Code Online (Sandbox Code Playgroud)
这是一个示例存储库:https://github.com/justin808/react-tutorial-hot/tree/es6
此演示显示:1.Webpack和热重载2. React 3. ES6
在 rails db 创建脚本 schema.rb 中,顶部有这一行:
ActiveRecord::Schema.define(:version => 20111127090505) do
Run Code Online (Sandbox Code Playgroud)
文档(http://api.rubyonrails.org/classes/ActiveRecord/Schema.html)说信息哈希参数是可选的
这可能是Ruby做得更好的东西,但有更好的方法来编写这个Javascript代码(对于React):
handleCellChange: function(rowIdx, prop, val) {
var updateObj = {};
updateObj.data = {};
updateObj.data[rowIdx] = {};
updateObj.data[rowIdx][prop] = { $set: val };
var newState = React.addons.update(this.state, updateObj);
Run Code Online (Sandbox Code Playgroud) 在Jetbrains产品中,如IntelliJ和RubyMine,你可以在git diff的diff窗口中点击F4跳转到当前编辑.Magit中是否有任何功能可以让emacs从git直接转到diff?