Archive for June, 2011

Grid Archives 1.2.0

Continue with our CDD i process

As indicated in this comment, before 1.2.0 grid archives resource files (css, js etc) are loading on every page. This is actually a common plugin issue as that’s the default behavior of wordpress’s 2 API functions: wp_enqueue_script() and wp_enqueue_style().

To avoid loading resources on every page and thus improve the load speed of the whole site, Grid Archives 1.2.0 added an option to allow user to enable loading plugin resources only in specific pages and posts. The page/post name can be configured in the grid archives settings page.

[ChangeLog]

  • added a option to enable load plugin resources only in specific pages and posts.

[Screenshots]

[Footnotes]
  1. Comment Driven Development []

Grid Archives 1.1.0

Grid Archives now seems work pretty good with the CDD (Comment Driven Development) process

This release is driven by this comment. As I said, the plugin is now totally driven by comments, so as always, thanks for these who trying this plugin out and giving back the precious feedback.

In this release, grid archives now support displaying posts from one specific category, just input [ grid_archives category=”Category name” ] i in your page/post, the category is the category name you want to display. For backward compatibility, the old [ grid_archives ] will still work and will still show all the posts as it did before.

[ChangeLog]

  • added a shortcode category attribute to display articles under one specific category, grid-archives now support [ grid_archives category=”Category name” ]

Please visit the plugin home page for more details.

[Footnotes]
  1. remove the space after “[” and before “]” []

喝coffee写coffeescript

好吧,这回中文,亚历山大……

其实英文有英文的好处,比如英文会使本人比较focus,因为没兴趣也没能力瞎扯,于是主题明确而不拖泥带水;中文的坏处便是我会常常迷失主题,跑题千里后蓦然回首,那人竟然还在灯火阑珊处……

anyway……

前几天看到sunng的take my coffee,一看title以为必是coffeescript,结果竟偏是如此纯结(纯是纯净水的纯),看来还是哥多虑了…… 想来最近的blog title里面随便带个coffee都会让人浮想联翩,coffee script的“火”冒三丈也就可见一斑。

标题起源于上周想到一个idea,便是让live fortune定时publish到新浪微博或是twitter,目前新浪的publisher已经实现,并顺便refactor了一下code,让之后twitter publisher的加入变的十分简单(在plan中);实现的过程中再次发现了sina clone的迹象,因为其oauth实现竟然连url抄的都一模一样,倒是方便了实现,因为twitter oauth的sample code基本上改个site base url后就能完全照搬,暂且认为这是新浪有意而为之的吧,目的便是方便第三方开发人员……

本来这篇文章一直draft着,再加上周末一直不available,所以拖到现在,为了应景,还特地决定一大早先跑去喝杯咖啡后再来奋笔疾书,无奈公司咖啡机几近坏掉,我修了半天搞的满身都是最后还是勉强喝到了一点味道有稍许异样的不知道还能不能叫做coffee的”coffee”,看来杯具如我辈是永远达不到sunng那种小资情调的呵呵;

吃葡萄不吐葡萄皮,不吃葡萄倒吐葡萄皮. i

[Footnotes]
  1. 喝coffee不写coffeescript,不喝coffee倒写coffeescript []

Deploying Live Fortune (Node.js) with Nginx and Monit

Here we will use Nginx to serve static resources and reverse proxy dynamic requests to the Node server. We will also use Monit to monitor the Node server and restart it automatically in case it crash. This is also the deployment I did at fortune.crash4.us.

[Nginx: Static Resources]
livefortunes use express.static to server static resources, but for better performance we will use nginx to do the job that it’s designed and built to do.

Config nginx to server all the static resources which located under /public :

server {
    listen       80;
    server_name  fortune.crash4.us;
    root         /path/to/livefortunes/public;
    index        index.html;

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
         root   html;
    }
}

Continue reading →