ssh上传下载

No Comments

上传: scp test.sql zhangying@192.168.1.5:/var/www/zhangying 下载: scp zhangying@192.168.1.5:/var/www/zhangying/test.sql /home/zhangy/database_bak/ 阅读全文...

修改Textmate中使用的ruby版本

No Comments

在用homebrew安装了最新的ruby 1.9.3之后,Textmate中编写ruby脚本依然使用的是系统自带的1.8.7。修改的办法是在Textmate的环境变量里面加入一个键“TM_RUBY”,值为新安装的ruby的路径。比如我的路径为“/usr/local/bin/ruby”。 这样修改之后虽然Textmate调用的是最新版的ruby,但是Textmate的出错信息却乱了,显示为: google了很多才找到解决办法: http://www.rubyflow.com/items/6795-sol  阅读全文...

Mac限速软件

No Comments

xcode4.3之前自带一个模拟网速的软件,叫Network Link Connector,开启之后可以模拟低俗网络。xcode到4.3之后就不再提供这个软件了,只能单独下载。 地址是developer.apple.com/downloads,搜索“Hardware IO Tools”。 参考:http://cocoa.venj.me/blog/simulate-low-speed-network-connection-for-ios-apps/ 阅读全文...

查找所有的.svn目录并删除

No Comments

cd /some/of/your/folders/ rm -rf `find . -type d -name .svn` 阅读全文...

XCode用Distribution证书调试的时候报“Error launching remote program: failed to get the task for process”错误的解决方法

No Comments

加入Entitlements.plist文件,加入一个字段“get-task-allow”,设为YES,在Targets->build Settings->Code Signing Entitlements确保选中你加入的Entitlements.plist文件。 4.2以上的版本没有加入Entitlements.plist文件的选项了,在target下面直接有一个Entitlements节,勾选之后就会生成一个.entitlements文件,操作同样。 官方的解释是这样的: get-task-allow, when signed into an a  阅读全文...

卸载MacRuby的方法

No Comments

首先用pkgutil命令找到安装的那个pkg: pkgutil –pkgs |grep -i ruby # get all related to ruby 然后找到安装的文件: pkgutil –files com.apple.macrubyNightlyBuild.macruby-nightly.pkg 然后逐一删掉它们 阅读全文...

破解hyperdock 1.2.1

No Comments

原帖:http://bbs.weiphone.com/read-htm-tid-4237609.html 1. 下载hyperdock 1.2.1(包含一个无效的证书),先安装hyperdock,然后双击证书,使软件变成已注册状态(通常这个状态只能持续到下次开机). 2. 双击证书后,立马在finder中找到 “/Library/PreferencePanes/HyperDock.prefpane” ,把HyperDock.prefpane改为HyperDock,即去掉后缀名. 3. 打开系 “统偏好设置-安全性与隐私-防火  阅读全文...

Internet Explorer conditional comments

No Comments

原来HTML针对IE有一种特殊的写法,可以根据IE的版本输出不同的信息: <p class="accent"> <!--[if IE]> According to the conditional comment this is IE<br /> <![endif]--> <!--[if IE 6]> According to the conditional comment this is IE 6<br /> <![endif]--> <!--[if IE 7]> According to the conditional comment this is IE 7<br   阅读全文...

Bitbucket加入本地版本库的方法

No Comments

Create a repo on Bitbucket Change the origin url in the local repo git remote set-url origin [Bitbucket url to your repo] Push the code back git push origin master 阅读全文...

respond_to

No Comments

在Rails的action里面根据请求的格式返回不同的格式,代码是这么写的: respond_to do |format|      format.html format.json { render :json => @people.to_json }      format.xml { render ml => @people.to_xml }    end 那怎么判断客户端请求的格式呢?原来在请求的HTTP头有一个字段Accept,就是根据这个字段的值来判断的。比如把这个字段的值设为”application/json&  阅读全文...

Older Entries