Visualizing your code’s architecture [closed]

I am afraid that there is no perfect tool for comprehensive visualizing your program architecture and its control flow, you should keep them in your head and make your software architecture clean, uniform and predictable. However there are some tools that can help you. In Pycharm you can: view structure and hierarchy of the source … Read more

Rails Internationalization (I18n) in model validations: Possible or not?

The solution is to NOT include any custom message keys in the models, like… :message => I18n.t(‘activerecord.errors.models.my_model.attributes.whatever.please_select_whatever’) The model will then apply the default message keys, for example “:inclusion” in the case of “validates_inclusion_of” …and in config/locales/en.yml you need to have: en: activerecord: errors: models: my_model: attributes: whatever: inclusion: “Please select whatever.” # see default … Read more

disabling Devise registration for production environment only

Edit the user model and remove :registerable, I think that should give you what you want. Edit: I think this would work: if Rails.env.production? devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable else devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable, :registerable end

Deploying a production Node.js server [closed]

You should really really use a framework (I recommend something like Express since it was battle-tested) unless you want to deal with sessions, cookies, middleware etc by yourself. Express is really light. Starting the server with nohup: you shouldn’t do that, just start it with the regular “node” command. Also Express wraps the routes in … Read more

Performance impact of using css / javascript source-maps in production?

A quick test using Charles Web Proxy shows that source maps are only loaded if developer tools are opened. If you load a page without dev tools opened, there is no http request for source maps. The behaviour was the same in Chrome 43 and Firefox 38. So it appears they would be no impact … Read more

SQLite as a production database for a low-traffic site?

SQLite doesn’t support any kind of concurrency, so you may have problems running it on a production website. If you’re looking for a ‘lighter’ database, perhaps consider trying a contemporary object-document store like CouchDB. By all means, continue to develop against SQLite, and you’re probably fine to use it initially. If you find your application … Read more