bullet 4.0.0 released (support mongoid) huangzhimin.com
flyerhzm — 69 posts
use after_commit rails-bestpractices.com
Most developers use AR callbacks after_create/after_update/after_destroy to generate background job, expire cache, etc., but they don't realize these callbacks are still wrapped in database transaction, they probably got unexpected errors on production servers. I wrote a post to suggest you that you should use after_commit for those callbacks that no need to execute in one transaction.
master slave replication in rails huangzhimin.com
I just created a new post master slave replication in rails to introduce maser slave replication, how to use in rails, and the solution to replication lag.
bullet 2.3.0 released huangzhimin.com
bullet is a gem to help you increase your application's performance by reducing the number of sql requests it makes. bullet 2.3.0 got 10% performance improved for activerecord 3.0.12, it works much faster, bullet for ar 3.1.4 is 48% faster than for ar 3.0.12, and for ar 3.2.2 is 40% faster than for ar 3.0.12, check out the changelog here.
It has been a long time coming, but switch_user 0.7.0 finally supports restful_authentication. switch_user gem provides a convenient way to switch current user that speeds up your development and reproduce user specified error on production.
multiple_mailers - send emails by different smtp accounts huangzhimin.com
I just released a gem multiple_mailers, it extends actionmailer to allow one smtp account per mailer class. I also wrote a blog post to explain.
rails_best_practices 1.9.0 released rails-bestpractices.com
I just released rails_best_practices 1.9.0, it adds "protect mass assignment" check, helps you avoid being hacked like github, check out the changelog here
rails_best_practices 1.8.0 released rails-bestpractices.com
I just released rails_best_practices 1.8.0, it adds not use time_ago_in_words check, provides better foreign key and routes analyzer, etc., check out the changelogs here
Not use time_ago_in_words rails-bestpractices.com
Rails provides helper method
time_ago_in_words to calculate the time distance, but it's not good, we should use client side solution instead, Not use time_ago_in_wordsI moved two repositories rails_best_practices and rails-bestpractices.com from my personal account to railsbp organization on github, https://github.com/railsbp/rails_best_practices and https://github.com/railsbp/rails-bestpractices.com
rails_best_practices 1.7.0 released rails-bestpractices.com
I just released rails_best_practices 1.7.0, it supports slim template engine and mongomapper now, check out the changelogs here
I just released bullet 2.1.0, bullet helps you to kill N+1 queries and unused eager loading, it's a long delay but finally it support rails 3.1.
rails_best_practices 1.6.0 released rails-bestpractices.com
I just launched rails_best_practices 1.6.0, it adds remove unused methods in helpers check, add mercurial support, check out the changelogs here
rails_best_practices 1.5.0 released rails-bestpractices.com
I just launched rails_best_practices 1.5.0, it supports mongoid and cells, implements a better erb parser, check out the changelogs here
rails_best_practices 1.4.0 released rails-bestpractices.com
I just launched rails_best_practices 1.4.0, it adds RemoveUnusedMethodsInControllersCheck, check out the changelogs here.
rails_best_practices 1.3.0 released rails-bestpractices.com
I just launched rails_best_practices 1.3.0, it adds new option --with-git to display git commit and git author in html format and enable RemoveUnusedMethodsInModelsCheck by default, check out the changelogs here.
use cells to abstract view widget rails-bestpractices.com
I just wrote a post use cells to abstract view widgets, it tells you how cells gem make your view code more reusable, testable and cacheable.
optimize db migration rails-bestpractices.com
I just wrote a post optimize db migration to merge/optimize db migrations for production deployment.
rails_best_practices 1.1.0 released rails-bestpractices.com
I have released rails_best_practices 1.1.0, adding "restrict auto-generated routes" check, check out the release announcement.
simple_cacheable gem rails-bestpractices.com
I just released simple_cacheable gem, it provides the cache apis for find(id), find_by_xxx, instance method and association, here is an introduction blog post.
rails_best_practices 1.0.0 & 1.0.1 released rails-bestpractices.com
I just released rails_best_practices gem 1.0.0, rewriting the parser by ripper, which perfectly supports ruby 1.9 (json hash), version 1.0.1 fix an error about line number of constant node, release note is here. I also wrote a blog post use ripper instead of ruby_parser to share my knowledge.
I have released rails_best_practices 0.9.0 and 0.10.0, adding "remove empty helpers" and "remove tab" checks, check out the gem here.
rails_best_practices 0.9.0 released rails-bestpractices.com
Post jobs on rails-bestpractices.com rails-bestpractices.com
I'm glad to say that job board has been added to rails-bestpractices.com, you can post ruby/rails related jobs on it, it's free now. I hope companies can find good rails developers and rails developers can find good rails jobs on it, it's a win-win.
split route namespaces into different files rails-bestpractices.com
I just wrote a post split route namespaces into different files, it makes your routes much easier to maintain.
rails_best_practices 0.8.0 released rails-bestpractices.com
I just released rails_best_practices 0.8.0, it supports simplify render in views check and simplify render in controllers check, and fix a few bugs, see more here.
rails_best_practices 0.7.4 released rails-bestpractices.com
rails_best_practices 0.7.4 released, it brings SchemaPrepare, which makes reviews more accurate, see more here.
my experience to upgrade mongoid huangzhimin.com
I have written a serial of posts to introduce my experience how to upgrade mongoid from 2.0.0.beta.19 to 2.0.0.rc.7, check them out here.
rails_best_practices 0.7.2 released rails-bestpractices.com
I just released rails_best_practices 0.7.2, it allows writing your own check list, I believe you will like it, see more here.
Migrate from authlogic/authlogic-connect to devise/omniauth rails-bestpractices.com
My recent blog post tells you how I migrated authentication system from authlogic/authlogic-connect to devise/omniauth for rails-bestpractices.com
rails_best_practices 0.7.0 released rails-bestpractices.com
I just released rails_best_practices 0.7.0, it adds remove trailing whitespace check and use multipart/alternative as content_type of email check support, I also did some refactorings and added better html output support. See more changelogs here.
Migrate Custom Blog to Jekyll and Disqus huangzhimin.com
I have rewrited my custom blog, using jekyll and disqus, so the first new blog post introduce how to use jekyll and some extensions/plugins, and alos two scripts to migrate old posts to jekyll and migrate old comments to disqus
I just released mongoid-eager-loading 0.3.0, I fixed a big issue and made it work well with latest mongoid, it gives a great performance improvement for queries with association.
Develop and Autotest your rubygem rails-bestpractices.com
I just wrote two articles to share my experience to develop and autotest a rubygem, one is Using bundler and rvm to build a rubygems and the other is Autotest your rubygem, hope they are helpful to you.
rails_best_practices 0.6.0 released rails-bestpractices.com
I just released rails_best_practices 0.6.0, I did a lot of refactorings, created rdoc webiste and google group, check out the announcement here.
comment your magic code rails-bestpractices.com
My recent post Comment your magic codes, it said you have to write comments for your metaprogramming codes to make it easy to read for other developers, and it also gives two good comment examples.
Simplify render in views rails-bestpractices.com
my recent post Simplify render in views shows you the more simplified syntax for render helper which introduced from rails 2.3.
remove trailing whitespace rails-bestpractices.com
my recent post remove trailing whitespace tells you don't make noises in git commits.
Use memoization rails-bestpractices.com
This is my new post Use memoization to speed up function calls, and in the comments, I also give a short description about the memoize internal implementation in rails.
rails_best_practices 0.5.0 released rails-bestpractices.com
I have released rails_best_practices 0.5.0, it adds the use query attribute checker.
Inspired from hobo, switch_user provides a convenient way to switch current user that speeds up your development, so that you don't waste your time to logout, login and input email (login) or password any more. It can help you reproduce the user specified error in production as well.
mongoid-eager-loading gem released github.com
I just released my new gem mongoid-eager-loading, adds the eager loading feature for mongoid.
Select specific fields for performance rails-bestpractices.com
I wrote an article Select specific fields for performance, it tells you that selecting specific fields can speed up the query and save memory for you.
rails_best_practices 0.4.5 released github.com
I have released rails_best_practices 0.4.5, it adds the use say_with_time in migrations checker.
Use query attribute rails-bestpractices.com
I have wrote an article Use query attribute, it gives you a hint that you should use query attribute to simplify check if ActiveRecord's attributes exist or not.
rails_best_practices 0.4.4 released github.com
I have released rails_best_practices 0.4.4, it adds the dry bundler in capistrano check.
rails_best_practices 0.4.1 released github.com
I have released rails_best_practices gem 0.4.1, it uses rvm and bundler to setup the development and test environment, adds progressbar and colored output for analyzing result.
Generate polymorphic url rails-bestpractices.com
I have wrote an article Generate polymorphic url, it gives you a hint that you should use the polymorphic_path/polymorphic_url to simplify the polymorphic url generation.
Use batched finder for large data query rails-bestpractices.com
I have wrote an article Use batched finder for large data query, it tells you how to save memory when querying large data.
DRY bundler in capistrano rails-bestpractices.com
I have wrote a article DRY bundler in capistrano, it just gives you a notice that there are built-in capistrano tasks existed in Bundler 1.0.
Put scripts at the bottom rails-bestpractices.com
I wrote an article Put scripts at the bottom, it is a small trick, but really helpful to speed up the pages render. I also give an example for adding a tweet button on your pages
Fetch current user in models rails-bestpractices.com
I wrote an article Fetch current user in models, you may know it, but this technique is useful for new comer.
Ask for best practices on rails-bestpractices.com rails-bestpractices.com
http://rails-bestpractices.com added a new feature, asking for best practices, it allows users to ask for a best practice about any rails-related work, such as "How to detect N+1 queries?" and "How to upload a large file with progress bar?". Then everyone can post your answer with your own best practice solution to the questions. Check it here.
Use STI and polymorphic model for multiple uploads rails-bestpractices.com
I wrote an article Use STI and polymorphic model for multiple uploads, it provides a flexible and reusable solution for multiple uploads by using paperclip.
rails_best_practices 0.4.0 released github.com
I have released rails_best_practices 0.4.0, rails_best_practices is a code metric tool for rails codes, from 0.4.0, it can check the rails3 codes better.
In addition, if you want to add your rails best practices into the gem, please post your best practices on http://rails-bestpractices.com
In addition, if you want to add your rails best practices into the gem, please post your best practices on http://rails-bestpractices.com
Use multipart/alternative as content_type of email rails-bestpractices.com
I wrote an article about using multipart/alternative as content_type of email. Rails uses plain/text as the default content_type for sending email, you should change it to multipart/alternative that email clients can display html formatted email if they support and display plain text email if they don't support html format. Check it here.
rails-bestpractices.com is now launched rails-bestpractices.com
I'm glad to say http://rails-bestpractices.com is now launched. It's a website that provides the best practices to write rails codes and anybody can share his/her practices. It's also the home page of rails_best_practices gem. ihower is also the administrator who is the presenter of Rails Best Practices presentation. Welcome to share your practices here.
bullet 2.0.0.beta.3 gem released github.com
I just released bullet 2.0.0.beta.3 gem, which is aimed to kill N+1 queries and unused eager loadings. It is compatible with rails 3.0.0.beta4 now. With sriedel's help, a lot of refactors are done, and xmpp notification is added. Enjoy it!
resque-restriction 0.2.0 released github.com
I have released resque-restriction 0.2.0, which is mainly contributed by @wr0ngway, fixing some bugs and adding customized identifier for resque queue. I also added an example on README.markdown about how to restrict facebook wall posts 40 times per user per day.
Convenient way to browse issues on github github-issues.heroku.com
I have a few repositories on github. Several of them have issues, but it's not convenient for me to browse the issues from one repository to another. So I build a website Github Issues to fetch all my issues on github in one page after I type my github username.
resque-restriction github.com
I have posted a resque plugin, resque-restriction. It will limit the execution number of certain jobs in a period time and execute the exceeded jobs at the next period. It is especially useful when a system has an email invitation resque job, because sending emails too frequently will be treated as a spam. For example, resque-restriction can restrict the email invitation job not execute more than 1000 times per day, 100 times per hour and 30 times per 300 seconds.
css sprite best practices huangzhimin.com
I have written a post css sprite best practices. Following the practices, you will be saved from dull css sprite job. It also tells you how to automatically do the css sprite job by using my css_sprite gem.
I just released twitter_connect gem. It popups a window to authenticate twitter oauth, like facebook connect, which is especially suit for the application in iframe or you don't want user leave your website. There is also a demo, check it here
bullet2 beta released, supports rails3 beta github.com
I just upgraded bullet gem to version 2.0 beta, which supports rails3 beta. Bullet gem helps you to kill N+1 queries and unused eager loading.
seo_checker 0.2.3 released github.com
I just launched seo_checker, which checks your website if it is seo. It mainly checks the url, title and descripion of web page according to the sitemap.
RubySlide.com rubyslide.com
RubySlide.com, inspired by RubyTu.be, gathers all the latest Ruby slides and presentations in one convenient place!
I have forked metric_fu and add rails_best_practices to it. rails_best_practices is a great gem to check your rails app codes and give you some good suggestions for better rails codes. Check the flyerhzm-metric_fu for your rails app.
rails_best_practices gem rubyflow.com
ihower introduced his Rails Best Practices presentation before, my rails_best_practices gem is used to automatically check your rails app files according to his presentation.
The flyerhzm-bullet gem is designed to help you increase your application’s performance by reducing the number of queries it makes. It will watch your queries while you develop your application and notify you when you should add eager loading (N+1 queries) or when you’re using eager loading that isn’t necessary.
It also provides some notification, such as javascript alert, browser console.log, bullet log, rails log and growl.
I think you will really like it.
It also provides some notification, such as javascript alert, browser console.log, bullet log, rails log and growl.
I think you will really like it.
