Peterfei

上主是我的牧者,我实在一无所缺


  • 首页

  • 归档

  • 标签

IOS 打包script

发表于 2015-07-03   |   分类于 IOS   |  

无签名打包命令

1
2
3
4
5
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
if [ "${PLATFORM_NAME}" == "iphoneos" ] || [ "${PLATFORM_NAME}" == "ipados" ]; then
/Applications/Xcode.app/Contents/Developer/iphoneentitlements/gen_entitlements.py "my.company.${PROJECT_NAME}" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent";
codesign -f -s "iPhone Developer" --entitlements "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/"
fi

ionic学习笔记1

发表于 2015-07-03   |  

#Ionic Add Platform EACCES Error 解决办法
*当出现platform add [platformname]

Error: spawn EACCES
at exports._errnoException (util.js:746:11)
at ChildProcess.spawn (child_process.js:1155:11)
at Object.exports.spawn (child_process.js:988:9)
at Object.exports.spawn (/usr/local/lib/node_modules/cordova/node_modules/cordova- lib/src/cordova/superspawn.js:100:31)
at runScriptViaChildProcessSpawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-
lib/src/hooks/HooksRunner.js:188:23)
at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova- lib/src/hooks/HooksRunner.js:131:16)
at /usr/local/lib/node_modules/cordova/node_modules/cordova- lib/src/hooks/HooksRunner.js:114:20
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
*

加入ionic hooks add
then
ionic platform add ios

ruby类扩展混入

发表于 2014-10-09   |  

Mac下sublime3快捷键备忘

发表于 2014-09-27   |  

打开/前往

  • ⌘^A (对齐)
  • Alt鼠标单击 [多行选择]
  • ⌘T [前往文件]
  • ⌘⌃P | 前往项目 |
  • ⌘R | 前往 method |
  • ⌘⇧P | 命令提示 |
  • ⌃G | 前往行 |
  • ⌃ ` | python 控制台 |

    编辑

  • ⌘L | 选择行 (重复按下将下一行加入选择) |

  • ⌘D | 选择词 (重复按下时多重选择相同的词进行多重编辑) |
  • ⌃⇧M | 选择括号内的内容 |
  • ⌘⇧↩ | 在当前行前插入新行 |
  • ⌘↩ | 在当前行后插入新行 |
  • ⌃⇧K | 删除行 |
  • ⌘KK | 从光标处删除至行尾 |
  • ⌘K⌫ | 从光标处删除至行首 |
  • ⌘⇧D | 复制(多)行 |
  • ⌘J | 合并(多)行 |
  • ⌘KU | 改为大写 |
  • ⌘KL | 改为小写 |
  • ⌘ / | 注释 |
  • ⌘⌥ / | 块注释 |
  • ⌘Y | 恢复或重复 |
  • ⌘⇧V | 粘贴并自动缩进 |
  • ⌃ space | 自动完成(重复按下选择下一个提示) |
  • ⌃M | 跳转至对应的括号 |

查找/替换

  • ⌘F | 查找 |
  • ⌘⌥F | 替换 |
  • ⌘⌥G | 查找下一个符合当前所选的内容 |
  • ⌘⌃G | 查找所有符合当前所选的内容进行多重编辑 |
  • ⌘⇧F | 在所有打开的文件中进行查找 |

ruby api设计

发表于 2014-09-27   |  

#先看一段source code

1
2
3
4
5
6
7
8
9
10
11
f = File.open("myfile.txt", 'w')
f.write("Lorem ipsum dolor sit amet")
f.write("Lorem ipsum dolor sit amet")
f.close
||
\/
# using block
File.open("myfile.txt", 'w') do |f|
f.write("Lorem ipsum dolor sit amet")
f.write("Lorem ipsum dolor sit amet")
end

#如上,是使用block后的效果,再来一段

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# without code block
def send_message(msg)
socket = TCPSocket.new(@ip, @port) # Pre-
socket.puts(msg)
response = socket.gets
ensure
socket.close # Post-
end
end
||
\/
# with code block
def send_message(msg)
connection do |socket|
socket.puts("foobar")
socket.gets
end
end
def connection
socket = TCPSocket.new(@ip, @port) # Pre-
yield(socket)
ensure
socket.close # Post-
end
end

#Module 的使用

1
2
3
4
5
6
7
8
9
module Mixin
def foo
puts "foo"
end
end
class A
include Mixin
end
A.new.foo # foo

.使用extend(Mod)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Mixin
def foo
puts "foo"
end
class A
extend Mixin
end
end
A.extend(Mixin)
A.foo # class method
the same as
class << A
include Mixin
end

.obj.extend(Mod)
如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Mixin
def foo
puts "foo"
end
end
a = "test"
a.extend(Mixin)
a.foo # foo
the same as
class << a
include Mixin
end
b = "demo"
b.foo # NoMethodError

.Mixin with class methods

1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Mixin
def foo
puts "foo"
end
module ClassMethods
def bar
puts "bar"
end
end
end
class MyClass
include Mixin
extend Mixin::ClassMethods
end

等同于如下代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Mixin
# self.included is a hook method
def self.included(base)
base.extend(ClassMethods)
end
def foo
puts "foo"
end
module ClassMethods
def bar
puts "bar"
end
end
end
class MyClass
include Mixin
end

等同于:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module Mixin
def self.included(base)
base.extend(ClassMethods)
base.send(:include, InstanceMethods)
end
module InstanceMethods
def foo
puts "foo"
end
end
module ClassMethods
def bar
puts "bar"
end
end
end
class MyClass
include Mixin
end

1…13141516
peterfei

peterfei

peterfei|技术|上主是我的牧者

77 日志
14 分类
62 标签
RSS
github
© 2023 peterfei
由 Hexo 强力驱动
主题 - NexT.Mist