Neethack

Bacon.js for Dummies

| Comments

Bacon.js is an FRP module for events on javascript. Which can transform your event listener/handler to a functional event stream. After servey a few blogs and example project, I found it is a really interesting concept and can make event handling speghetti code into clear functional logics.

Event stream

First, what is event stream? Actually it is nothing special, it is just an event listener that listen to specific event.

For example,

$("#clickme").on('click', function(event){ alert(event.target)})

Can transfer to event stream by Bacon.js’s asEventStream helper:

clicked = $("#clickme").asEventStream('click')

And add handler to event stream, listen to click event:

clicked.onValue(function(event){ alert(event.target) })

Express Bigpipe Experiment

| Comments

Bigpipe

Bigpipe is an unique frontend technique used by Facebook to increase their page rendering speed.

When I read the article talk about bigpipe on facebook, I was pretty shocked about how facebook implements those unique ideas to increase their page rendering speed.

Recently I am using node.js for web development, I think the async structure of node is a perfect environment to use this technique, so I wrote a small experiments app with express:

Understand Event Loops

| Comments

Event loop is the core feature in node.js, and is also the reason why it is better on handling requests and realtime communication like long polling.

The Obstacle of IO

The reason is on this is because the I/O is expensive:

Review of 2012

| Comments

2012 is a great year for me, lots of new things and new experience happened, and I also explored and learned lots of things in software from work and projects.

In the last day of 2012, I think it is a good time to review what I have done in this year, what I can improve and my expectation for the incoming year.

Announcing Papercut

| Comments

Inspiring by carrierwave on Rails. I wrote a image processing framework to handle images with different versions on node.js and express. Integrate with node-imagemagick and can upload image to Amazon S3. It is just a simple version of carrierwave with similiar Api. But I am comfortable with the features, which is enough for my requirement right now. I will try to improve the image processing efficiency, and add more processing options for future usage.

You can check this project on Github

Minispec : Mini BDD Framework in Coffeescript

| Comments

Just another test framework

During the catastrophe of Sandy storm, my place have no electricity and water, so I stay in my friends place for whole week. And I need to find something to do except eating, surfing internet and boardgame. So I just wrote another test framework.

Inspired by Zach Holoman’s gist I try to host the framework in the gist form. Because every gist is also a git repository.

gist source

Reading: The Lean Startup

| Comments

A startup is a human institution designed to deliver a new product or service under conditions of extreme uncertainty.

Recently I finally finish reading the lean startup book.

The author Eric Ries is writing blog for sharing his startup experience for several years. This book is include his experience of his own startup and tutoring experience. He points out lots of the critical problems that a startup will face. Include finding market fit, testing hypothesis and validate growth.

As an employee of a startup, It is a really interesting book.

Twelve Factors App

| Comments

The Twelve Factors App is a methodology that a web application should follow to be able to easily deploy and scale on today’s SAAS platform like Heroku. This methodolgy is announced by the Heroku Founder Adam Wiggins. The content is the based on their experience of deploying millions of applications.

When I first saw this declaration, I just feel that this might be extract from rails and herokus best practices, but actually this declaration is more then practices but a methodology to improve the maintainbility and scalability of web application. so I like to share Heroku engineer’s slide about 12 factors app:

Bootstrap Your Ember.js Application

| Comments

Ember.js is a javascript MVC framework developed by Rails core team member Yehuda Katz, Tom Dale and Charles Jolley. Compare to other javascript MVC framework, Ember.js not only provide a MVC framework for seperation of logics, but also focusing on some common problems when developing complex javascript application.

Binding

One common problem of javascript application is how to manipulate DOM element and insert data into DOM, for example, a jQuery app retrive user data and show on screen will look like this:

Announcing N37 Url Shortener

| Comments

Few days ago, I started to work on a simple url shortener. The original idea was from one of my friends, he mentioned about the idea of implement a simple and deployable url shortener. This idea just popout my head when I was working on other side project. So I spend a few days working on it and it turns out to be an interesting project that I want to blog about:

A Url Shortener

A url shortener, as its name, is a application that provide user a shorter version of url. Like the most famous one: tinyurl.com, which map the url address into a short sequence of code, like tinyurl.com/ccxngqo. Make user easier to share the link on social media like twitter or forum.