Posts

Xcode Skill

02 Apr 2014

常用快捷键

简称:command == cm, shift == /s, control = /c, option(alt) == /a 用空格代替+, left = mouse left
cmd function
cm 0(1~8) toggle left(swith between left sub windows)
/c (1~6) swith between jumpbar
cm /a 0 toggle utility panel
cm /a (1~6) switch between inspector
cm /c /a (1~4) switch between libraries
/a left open in assistant editor
...

阅读全文 ...


使用Markdown

05 Mar 2014

使用MarkDown


Keywords

> # #, ##, ######, -, >, —, *, html tags, ![](),

当你要输入关键字的时候,使用backslash-escape
Markdown provides backslash escapes for the following characters:
  • \ backslash
  • ` backtick
  • * asterisk
  • _ underscore
  • {} curly braces
  • [] square brackets
  • () parentheses
  • # hash mark
  • + plus sign
  • - minus sign (hyphen)
  • . dot
  • ! exclamation mark
...

阅读全文 ...


使用CSDN Code

04 Feb 2014

How to Use Code

  • clone
  • push
 ssh key
 $ cd ~/.ssh
 $ mkdir key_backup
 $ cp id_rsa* key_backup
 $ rm id_rsa*
 生成新的密钥:
 $ ssh-keygen -t rsa -C “您的邮箱地址”
...

阅读全文 ...


lua面向对象编程

01 Feb 2014

lua面向对象编程风格代码示例

下面这段lua代码转载自云风的wiki,是一种使用lua进行OOP的方法尝试
local _class={}
 
function class(super)
	local class_type={}
	class_type.ctor=false
	class_type.super=super
	class_type.new=function(...) 
			local obj={}
			do
				local create
				create = function(c,...)
					if c.super then
						create(c.super,...)
					end
					if c.ctor then
						c.ctor(obj,...)
					end
				end
 
				create(class_type,...)
			end
			setmetatable(obj,{ __index=_class[class_type] })
			return obj
		end
	local vtbl={}
	_class[class_type]=vtbl
 
	setmetatable(class_type,{__newindex=
		function(t,k,v)
			vtbl[k]=v
		end
	})
 
	if super then
		setmetatable(vtbl,{__index=
			function(t,k)
				local ret=_class[super][k]
				vtbl[k]=ret
				return ret
			end
		})
	end
 
	return class_type
end
...

阅读全文 ...