All posts in Technique

What’s New in Firefox 4 (Part 2)

ok, 继续,接上篇 .

· You can turn any tab into an “App Tab” by right-clicking on it and selecting “Make into App Tab” from the context menu

蛮fancy的应用,fancy就fancy在人家safari,chrome,opera,IE不支持,fancy就fancy在也实用不到哪去,暂且就认为只是为了省空间吧,还只是视觉空间,说不定还多搞你点存储空间复杂度,空间换空间?好的.

· The default homepage design has been refreshed

自从用了 speed dial 之后,我已经不知道 homepage 张啥样好多年……

· Overhaul of the bookmarks and history code, enabling faster bookmarking and startup performance

nice code refactor, 一个字,为了速度,汗,好像是两个字……
Continue reading →

What’s New in Firefox 4 (Part 1)

标题看起来非常official,实际上就是很official… 因为咱是从mozilla的 official site 拷过来的…… 本来昨天就想拷的,结果事情实在太多,只好拖到现在,虽然有点out了不过也无妨,因为彼时彼刻,恰如此时此刻~

Firefox 4 is based on the Gecko 2.0 Web platform. This release features JavaScript execution speeds up to six times faster than the previous version, new capabilities for Web Developers and Add-on Developers such as hardware accelerated graphics and HTML5 technologies, and a completely revised user interface.

Firefox每次minor版本的更新都伴随着其内核 Gecko版本的更新 i,这次major版本更新,Gecko也索性来个大版本号,步调要一致,不然要扯着蛋,嗯…
我不知道你,反正我打开FF4的第一反应是快ii,这个跟6倍速 javascript 性能提升不无关系,当然肯定还有UI的优化,不像以前点个按钮给我个圈圈让我等,上了个厕所倒了杯水回来还是那个圈圈在那欢快的转…… 另外硬件加速,html5什么的我们下面应该会有具体细则,这里只是暂行条例,只是个大方向,详细的征收细则还需要之后由地方政府提供.
Continue reading →

[Footnotes]
  1. 话说回来,浏览器不更新这个还更新什么 []
  2. 注意,不是指初次启动速度,这个貌似还是painfully slow…… []

Terminal.app echo breaks after ctrl-c

基本的症状和 这里描述的问题 如出一辙,我也是 tail -f log/development.log 后出的问题,同道中人啊,提问者自己提供了两种解决方法(自问自答?):

$ stty echo

上面这个确实work,cool!

$ irb

货真价实的rubist,还想的出来这样的解决办法,不错不错,我也试了下,很遗憾在我这并不work…

底下的评论以及种种迹象表面这并不是mac自带的老版本bash的bug,而是一个bash-completion的bug,所以另外一个很make sense的solution就是更新bash-completion,我个人比较prefer这个solution,当然你也可以用macports安装最新版本的bash替换系统自带的bash,喜欢折腾的尽管上。

$ sudo port -v selfupdate
$ sudo port install bash-completion

verify一下,active的是1.3的bash-completion就算大功告成了。

$ port installed | grep bash-comp
  bash-completion @1.1_6
  bash-completion @1.2_0
  bash-completion @1.3_0 (active)

stdout customization

前面介绍完了deployment,接下来该轮到customization了,这个也同样重要。我目前所能想到的需要customize的地方主要有5个地方,都集中在两个文件,并没有想象中的复杂,且听我一一道来:

[page title]

Location: RAILS_ROOT/app/views/layouts/application.html.erb, line 6
<title>$ cat /dev/stdin >> /dev/stdout | tee stdout.samsonw.info</title>

change to whatever text you want.

[header title,sub-title]

Location: RAILS_ROOT/app/views/activities/index.html.erb, line 2, 3
<div id="title" class="grid_24">$ cat /dev/stdin >> /dev/stdout | tee stdout.samsonw.info</div>
<div id="sub_title" class="grid_24">Don't Panic: fatal system error, core dump file not generated ...</div>

change to whatever text you want.
Continue reading →

stdout deployment

首先值得一提的是为了支持HostMonster的fastcgi,我人为copy了几个以raild -D生成的项目结构里面的dispatch文件以及create了一个.htaccess文件,如果你不用fastcgi(通常情况下你不需要,而且也不推荐),你可以简单的删除它们(以下RAILS_ROOT是指rails app的根目录):

RAILS_ROOT/config.ru
RAILS_ROOT/public/dispatch.cgi
RAILS_ROOT/public/dispatch.fcgi
RAILS_ROOT/public/dispatch.rb
RAILS_ROOT/public/.htaccess

[Development Environment]
Assume你的os已经装好ruby,如果没有请自行google,这里不再赘述。

首先update一下rubygems,最近rubygems貌似打了鸡血,更新极其频繁… 且bug具多…如果出了问题建议rollback到1.4.2…
[Note: 由于我使用rvm,所以以下command都没有sudo,根据你的情况你可能需要加上sudo]

$ gem update --system

Continue reading →

stdout on github

stdout, aka LoserLogs or LoserStream is finally on github, check out at https://github.com/samsonw/stdout .

The code is based on rails 2.3.11 instead of rails 3, quite a surprise, isn’t it? Actually I was planning to, but after some research, it turns out my shared host provider HostMonster only support rails 2 at the time of this writing, shame on them.

It was always quite enjoyable to figure this and that out in the process of curating that site, except the deployment experiences on HostMonster. To my surprise, they’re still using Fastcgi to support rails application, again, shame on them.

Last but not least, the project is called “LoserLogs” and copyrighted by “Losers” corporation, cause I and along with some of my friends are all having the “loser” faith in our heart, this is NOT a joke :)

RubyGems 1.5.2 Manual Upgrade

今天想更新RubyGems,突然发现 gem update ––system 貌似不work了:

$ gem -v
1.5.0
$ gem update --system
Updating RubyGems
ERROR:  While executing gem ... (NoMethodError)
    undefined method `version' for nil:NilClass

turns out 这是 RubyGems 1.5.0 和 1.5.1 的一个bug,1.5.2 fix了这个issue。

Manual的Upgrade可以绕过 reinstall 的麻烦和繁琐,且更低碳环保:
Continue reading →

Is samsonw.info launched yet?

[tl;dr]

Q: samsonw.info launch了,吗?

A: 应该已经launch了,吧……

Grid Archives 0.9.0

Grid Archives 0.9.0 mainly focus on tweaking the archived posts display style, the changelog should pretty much covers all the changes need to be mentioned here.

[ChangeLog]

  • added an option to highlight the post if being mouse hovered over. (IE currently not supported)
  • added an option to rotate the monthly summary if being mouse hovered over. (IE currently not supported)
  • made the “year.month” text clickable to show all the posts in that particular month.

As always, please visit the archives page here to see a live demo.

[Screenshots]

推荐一个reader app和一个Greasemonkey脚本

今天推荐的两个东东都和阅读有关,一个是google reader的offline阅读器,还有一个是方便大家卓越当当京东购书,然后顺便查看豆瓣评论的Greasemonkey脚本。

[Google Reader app: Reeder]

Reeder据说是iphone/ipad等idevice上蛮流行的google reader app(具体我也不清楚),作者承诺过出for mac的版本,现在虽说还是beta版,但我这几天用下来感觉还是相当稳定的,有一些feed显示的小bug,不过无关痛痒。

功能现在还有点弱,所以一般管理feed的工作还是要在google reader里面进行,reeder只是作为consumer专门消费sync过来的content,在reeder里面标记为read的文章之后也会同步到google reader,所以不用担心reeder看过了google reader里面还是unread(即便是beta,这个功能还是必须的,所以我前面说的offline阅读器其实也不大准确…)


Continue reading →