Skip to content

Instantly share code, notes, and snippets.

@cicihu
cicihu / concepts.md
Last active December 25, 2015 06:19
漫步 Ember.js

概念

总体来说,Ember.js 基本遵循经典的 MVC 架构体系。和许多声称是 JavaScript MVC 的框架相比,Ember.js 更加正统。模型、视图(模板)、控制器,一一对应,职责明确且符合惯例。而 RESTful 数据适配和路由器等机制则无时无刻不让人想起 Ruby on Rails 框架以及许多追随者的身影。最新的组件(Components)机制又紧跟 Web/Browser 发展的潮流,毫不落伍。

模板(Template)

  • Handlebars;
  • 描绘应用的用户界面;
  • 依靠模型的支持,当模型改变时会自动更新自己;
  • 在 Plain HTML 的基础上,还可以包括:
@cicihu
cicihu / better_agile_development_01.md
Last active December 25, 2015 00:09
Better Agile Development

从目标中获取范围

“问题的表述常常比它的解决方案更重要。”——阿尔伯特·爱因斯坦

创建正确的范围

  • 理解“为什么”和“谁”

    要评估一个解决方案,需要先理解为什么需要某些东西以及谁需要它们。

@cicihu
cicihu / emacs-vim.md
Last active December 24, 2015 04:59
Emacs 与 Vim 相同(近似)指令参照表

Emacs 与 Vim 相同(近似)指令参照表

Emacs Vim 备注
C-n j
C-p k
C-f l
C-b h
M-f w/e #1
M-b b
@cicihu
cicihu / notes_on_ruby_001.md
Last active December 24, 2015 04:29
关于 Ruby 的技术笔记

数字的字面表示法 - Numerical Literals

Ruby 允许我们使用以下前导符号来表示不同的进制基数:

前导符号 进制 范例 转换为十进制
0b 二进制 0b10_0100 #=> 42
0 八进制 0377 #=> 255
0d 十进制(缺省) (0d)12_345 #=> 12345
0x 十六进制 0xabcd #=> 43981

I'm planning on either writing this up in detail or maybe doing a screencast about screencasting, but I'll give a short version here.

On sound quality:

This matters a lot. In decreasing order of importance:

  1. Remove echo. You have to hear this to understand. Set up a mic in front of your mouth and record a sentence. Then, put a thick comforter over you and the mic and say it again at the same distance. Listen to
@cicihu
cicihu / rm_all_with_exceptions.md
Created September 21, 2013 14:50
在命令行下删除除去指定目标以外的所有目标

假设在某路径下有 a.txt, b.txt, c.txt, d.txt, e.txt 五个文件,如何在保留特定某个的前提下删除其余的?

$ ls * | grep -v c.txt | xargs rm -f

grep -v-v--invert-match 即指定排除条件;

xargs:从 standard input 读取参数并以 spacetabnewlineend-of-line 作为分界符来分隔这些参数;然后传给它的参数——可以是一个处理命令。