HN user

gcao

40 karma

gcao99 at gmail

Posts8
Comments33
View on HN

How well does Spacemacs work in a terminal (e.g. iTerm)? I've been using iTerm+Tmux+vim and don't want to give up iTerm+tmux just yet.

Why not just recommend one way of naming things and do it in all standard APIs? If someone obviates in his custom library, that's his problem. I think below are pretty much a standard in many languages now.

THIS_IS_A_CONSTANT SomeClass someVariable someMethod()

In pry is it possible to return something when I exit the REPL? Like this:

  def do_something
    return binding.pry

    do_something_but_does_not_work
  end

  result = do_something
  process result
It might be very convenient if I put 'return binging.pry' just before the broken code. I can interactively fix the broken code and continue run outside of current method.

Mine crashes a lot. Usually after I send it to sleep when I go home. Next time when I wake it up, it starts up from crashed state. It might have something to do with some app I installed but I didn't spend time to figure that out yet.

Jon, do you mind if I send my resume and cover letter to you? If you find it a good fit to your team or any other team, please forward to the right person. I really appreciate you taking the time to review it.

My email is gcao99 at gmail.com

React is nice. I've created a simple library that shares same core concept - map DOM to Javascript objects. The difference is my lib uses Javascript standard data type, array, to represent tag, and hash(or object) to represent attributes, and strings for text contents. With a few tricks, I got a very powerful library - http://github.com/gcao/T.js. You can see an example written in CoffeeScript here

https://gist.github.com/gcao/8363743

IMHO, built-in support of api-only application is very good. Here are the reasons I can think of right now:

1. unify people who are looking for a standard approach to create api in Rails

2. clear separation between lower level http support and higher level html/js/css processing

3. performance improvement against using regular Rails for api

4. easier upgrade for app developers

Interesting project. I feel it is similar to https://github.com/gcao/T.js - my little Javascript template engine. However IMHO, json2html is too verbose for large document, and T.js is concise and provides some nice features(e.g. layout, attributes as hash etc).

Below is a T.js template written in Coffeescript. <code> tournamentResultTemplate = (data) -> return unless data.result

  [ "div.detail"
    [ "table"
      [ "tr"
        ["td", "Result"]
        ["td", data.result]
      ]
      if data.defeated
        [ "tr"
          ["td", "Defeated"]
          ["td", data.defeated]
        ]
      if data.lost_to
        [ "tr"
          ["td", "Lost to"]
          ["td", data.lost_to]
        ]
    ]
  ]
</code>

Go is never popular among ordinary people in China. I guess one reason is it takes a lot of time to finish a game. However, most chineses know how to play Xiangqi, the chinese counterpart of Chess.

With my due respect to guys behind Ember, I don't understand why Ember gets so much attention. It has been in works for 4~5 years now but has not reached its 1.0 status. I've seen many complaints about its learning curve, documentation etc. However, when people talk about Javascript web frameworks to learn, it is often brought up as a candidate. Maybe someone can tell me why people think it will be a serious contender in this fast moving area.

Better than Ack 14 years ago

This is great!

Even ack is fast, it still takes a few seconds when I search something inside my rails project. I hate waiting. If Ag can work with same options as ack, and with ack.vim by simply creating symbol link, it'll be great.

Btw, I noticed the output of ag does not highlight matches and include line numbers. Maybe those are what make it a lot faster?

AWS Marketplace 14 years ago

It's good to see this coming. However I don't understand the price structure some vendors are offering. Take Zend Server(below is the link) as an example, why should they charge a lot more on high-memory/high-cpu instance? Is it because the incurred traffic or usage is much higher? How does this compare to setup your own server but buy server license from them.

https://aws.amazon.com/marketplace/pp/B0078UB5X6/ref=gtw_msl...

I think Rails 3 has laid a good foundation to build next generation of web applications, or back end of web apps. With introduction of Asset Pipeline and built-in support of CoffeeScript/Sass etc, it is a lot easier to develop in Rails than before. The performance is still not ideal though.

Shameless plug here. If you use the Aspector gem I created, you could move validation logic into an aspect and test it. And apply aspect is very easy. Here is what the code will look like.

class Request < ActiveRecord::Base

end

class RequestValidation < Aspector::Base

  target do
    def has_unique_hash_id?
      exists?(:hash_id => hash_id)
    end
  end

  before :create do
    hash_id = SecureRandom.hex(12) until has_unique_hash_id?
  end
end

RequestValidation.apply(Request)

IMHO, the best way to improve reading speed is to read more and more. Once you know more words and can tell their meanings in shorter time, you read faster. There is a chinese idiom for it: 熟能生巧

I'm very interested in it. It looks like it is a Python web application, right? I'm a Ruby programmer and should be able to understand the code and steal some ideas if you don't mind :-P