GUIDE

The road ahead will be long and our climb will be steep

My Sublime Custom Config

| 0 Comments

  • User Preference:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
	"color_scheme": "Packages/Oceanic Next Color Scheme/Oceanic Next.tmTheme",
	"folder_exclude_patterns":
	[
		".svn",
		".git",
		".hg",
		"CVS",
		"tmp/*.tmp"
	],
	"font_size": 12,
	"ignored_packages":
	[
		"Vintage"
	],
	"save_on_focus_lost": false,
	"tab_size": 4,
	"theme": "Seti.sublime-theme",
	"translate_tabs_to_spaces": true,
	"trim_trailing_white_space_on_save": true
}
  • User Key Bindings
1
2
3
[
  { "keys": ["command+shift+f"], "command": "reindent"}
]

Clear Watchman Watch-list

| 0 Comments

Watchman: https://github.com/facebook/watchman

  • create file clear_watchman_list.rb in HOME folder.
1
2
3
4
5
6
require 'json'

result = JSON.parse %x{watchman watch-list}
result["roots"].each do |dir|
  system "watchman watch-del #{dir}"
end
  • define cwl command in .profile
1
2
# clear watchman list
alias cwl="ruby $HOME/clear_watchman_list.rb"
  • use cwl if we want to empty the watchman list.

What Can Cause a Cookie Not to Be Set on the Client?

| 0 Comments

Issues

I use ember at cliend, and start on localhost:4200; sinatra at server, start on localhost:9292.

Then I use response.set_cookie() to store user info, but I cannot see cookie setted just now on chrome console -> resource -> cookies -> localhost.

cliend code:

1
2
3
$.ajax({
  url: http://localhost:9292/user
})

cliend code:

1
2
3
4
5
6
response.set_cookie('Cookie-Name',
          :value => value,
          :expires => Time.now + 3600 * 24 * 14,
          :domain => @domain,
          :path => '/',
          :httponly => true)

Solution

Option in ajax:

1
2
3
xhrFields: {
  withCredentials: true
}

Response header in sinatra, Access-Control-Allow-Credentials: true, Access-Control-Allow-Origin: http://localhost:4200

Important

Don’t set localhost as a domain for your cookies because you need to set it to “” or FALSE

iPhone4 无 SHSH 从 iOS7.1.2 降级到 iOS6.1.3

| 0 Comments

经过艰辛的历程,终于将 iPhone4(GSM版) 成功降级;

  • 使用工具

爱思,红雪,平台windows7

  • 悲剧的报错

之前使用的是xp系统,结果出现写入 AppleLogo 失败,set Picture 0 failure…的报错,一直以为是手机硬件问题,纠结了半个多月。之后自己的 win7 电脑修好后,重新试了一下,竟然成功了。

  • 刷机过程 http://bbs.i4.cn/thread-18856-1-1.html

    • 使用红雪或爱思助手等工具查看手机的ECID

    • 找到对应 iOS 版本的 shsh 文件,打开文件,将 ECID 的改为自己手机的

    • 将修改后的 shsh 文件上传到爱思服务器

    • 使用爱思助手刷机,刷机前选中保持基带不升级

    • 使用红雪进行越狱,越狱时一定选择 Deactive 选项,否则开机后手机无服务

    • 每次关机后都必须使用红雪进行引导开机

    • 如果手机锁屏后睡死,请在 Cydia 中添加威锋源(apt.weiphone.com),再下载 insomnia pro 插件,保证锁屏系统不真正睡眠,但这样非常耗电。喜欢 iOS6 style 的朋友可以使用第二篇文章中的6.2.1的固件刷机,成功后不会出现睡死状况。

  • PS

这篇博客讲了直接使用无睡死的固件来刷机,http://bbs.app111.com/thread-640908-1-1.html ,下载好文章中给出的固件后,还是按照以上 3.4 - 3.6 的步骤来操作。